A decoding and encoding method, device and equipment thereof
By optimizing the processing of flag information in the prediction mode in video coding technology, the number of bits in the encoded bitstream is reduced, improving coding performance and decoding efficiency, and solving the problem of high coding overhead in inter-frame coding mode.
Patent Information
- Application Number
- CN202210249008.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-20
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2039-09-20
AI Technical Summary
In existing video coding technologies, the prediction mode indication information of inter-frame coding modes requires multiple bits to represent, resulting in high coding overhead and low coding performance.
By determining the prediction mode flag information of the current block, the flag values of candidate prediction modes are read or deduced from the encoded bitstream only when the decoding conditions are met, reducing unnecessary flag indication information transmission and optimizing the encoded bitstream.
It reduces the number of bits in the encoded bitstream, improves encoding performance and decoding efficiency, and simplifies the prediction mode process.
Smart Images

Figure CN114710663B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a decoding and encoding method, device and equipment thereof. Background Art
[0002] In order to save space, video images are transmitted after being encoded. The complete video encoding method may include prediction, transformation, quantization, entropy coding, filtering and other processes. Among them, predictive coding may include intra-frame coding and inter-frame coding. Furthermore, inter-frame coding uses the correlation of the video time domain to predict the current pixel using the pixels of the adjacent encoded images to effectively remove the redundancy of the video time domain. Intra-frame coding refers to using the correlation of the video space domain to predict the current pixel using the pixels of the encoded block of the current frame image to remove the redundancy of the video space domain.
[0003] In the related art, in order to realize inter-frame coding, multiple prediction modes are proposed. The encoder selects a prediction mode from multiple prediction modes as a target prediction mode, and uses the target prediction mode to encode the current block. When the encoder sends the encoded bit stream to the decoder, the encoded bit stream includes indication information of the target prediction mode. After receiving the encoded bit stream, the decoder determines the target prediction mode based on the indication information, and decodes the current block according to the target prediction mode.
[0004] However, when the indication information of the target prediction mode is carried in the coded bit stream, multiple bits may be required to indicate the target prediction mode, which results in a large number of bits, large coding overhead, poor coding performance, and low decoding efficiency. Summary of the invention
[0005] The present application provides a decoding and encoding method, apparatus and device thereof, which can improve encoding performance.
[0006] The present application provides a decoding method, the method comprising:
[0007] Determine prediction mode flag information of the current block, the prediction mode flag information includes a flag value of at least one candidate prediction mode among N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled; wherein, for each flag value of the candidate prediction mode, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag value is read from the flag indication information of whether the candidate prediction mode is enabled carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag value is the derived flag value of the candidate prediction mode;
[0008] Determine a target prediction mode enabled by the current block according to the prediction mode flag information, wherein the target prediction mode is one of the N candidate prediction modes;
[0009] The current block is decoded according to the target prediction mode.
[0010] The present application provides an encoding method, the method comprising:
[0011] Determine a target prediction mode enabled for a current block, where the target prediction mode is one of N candidate prediction modes for the current block;
[0012] Determine prediction mode flag information of the current block according to the target prediction mode; the prediction mode flag information includes a flag value of at least one candidate prediction mode among the N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled;
[0013] The current block is encoded according to the prediction mode flag information; wherein, for each flag value of the candidate prediction mode included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is carried in the encoded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is not carried in the encoded bit stream of the current block.
[0014] The present application provides a decoding device, the device comprising:
[0015] A first determination module is used to determine prediction mode flag information of a current block, wherein the prediction mode flag information includes a flag value of at least one candidate prediction mode among N candidate prediction modes, wherein when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled; wherein, for each flag value of a candidate prediction mode, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag value is read from the flag indication information of whether the candidate prediction mode is enabled carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag value is the derived flag value of the candidate prediction mode;
[0016] A second determination module is used to determine a target prediction mode enabled by the current block according to the prediction mode flag information, wherein the target prediction mode is one of the N candidate prediction modes;
[0017] A decoding module is used to decode the current block according to the target prediction mode.
[0018] The present application provides an encoding device, the device comprising:
[0019] A first determination module, configured to determine a target prediction mode enabled for a current block, wherein the target prediction mode is one of N candidate prediction modes for the current block;
[0020] A second determination module is configured to determine prediction mode flag information of the current block according to the target prediction mode; the prediction mode flag information includes a flag value of at least one candidate prediction mode among the N candidate prediction modes, and when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled;
[0021] A coding module, used for encoding the current block according to the prediction mode flag information; wherein, for each flag value of a candidate prediction mode included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is not carried in the coded bit stream of the current block.
[0022] The present application provides a decoding end device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;
[0023] The processor is used to execute machine executable instructions to implement the following steps:
[0024] Determine prediction mode flag information of the current block, the prediction mode flag information includes a flag value of at least one candidate prediction mode among N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled; wherein, for each flag value of the candidate prediction mode, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag value is read from the flag indication information of whether the candidate prediction mode is enabled carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag value is the derived flag value of the candidate prediction mode;
[0025] Determine a target prediction mode enabled by the current block according to the prediction mode flag information, wherein the target prediction mode is one of the N candidate prediction modes;
[0026] The current block is decoded according to the target prediction mode.
[0027] The present application provides an encoding end device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;
[0028] The processor is used to execute machine executable instructions to implement the following steps:
[0029] Determine a target prediction mode enabled for a current block, the target prediction mode being one of N candidate prediction modes for the current block; determine prediction mode flag information for the current block according to the target prediction mode; the prediction mode flag information includes a flag value of at least one candidate prediction mode among the N candidate prediction modes, and when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled;
[0030] The current block is encoded according to the prediction mode flag information; wherein, for each flag value of the candidate prediction mode included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is carried in the encoded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is not carried in the encoded bit stream of the current block.
[0031] It can be seen from the above scheme that in the embodiment of the present application, when determining the prediction mode flag information of the current block, for the flag value of each candidate prediction mode, if the current block does not meet the decoding conditions of the flag value of the candidate prediction mode, then the flag value is the derived flag value of the candidate prediction mode, rather than being parsed from the encoded bit stream, that is, there is no need to carry the flag value of the candidate prediction mode in the encoded bit stream, thereby reducing the number of bits in the encoded bit stream, reducing encoding overhead, improving encoding performance, simplifying the process of decoding the prediction mode, and improving the efficiency of decoding the prediction mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a schematic diagram of a video coding framework in one implementation of the present application;
[0033] Figure 2 is a flowchart of a decoding method in one embodiment of the present application;
[0034] Figure 3 is a flowchart of an encoding method in one embodiment of the present application;
[0035] Figure 4A-4J It is a schematic diagram of a method for encoding and decoding a prediction mode flag in one implementation of the present application;
[0036] Figure 5A is a structural diagram of a decoding device in one embodiment of the present application;
[0037] Figure 5B is a structural diagram of an encoding device in one embodiment of the present application;
[0038] Fig. 6A is a structural diagram of a decoding end device in one implementation manner of the present application;
[0039] Figure 6B It is a structural diagram of an encoding end device in one implementation of the present application. DETAILED DESCRIPTION
[0040] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the various embodiments of the present application. The singular forms of "a", "said" and "the" used in the present application and the claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items. It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used can be interpreted as "at the time of ... ", or "when ... ", or "in response to determination".
[0041] In the embodiments of the present application, a decoding method, apparatus and device are proposed, which may involve the following concepts:
[0042] Intra prediction and inter prediction technology: Intra prediction refers to the use of the correlation in the video spatial domain to predict the current pixel using the pixels of the coded block of the current image, so as to achieve the purpose of removing the spatial redundancy of the video. Inter prediction refers to the use of the correlation in the video time domain. Since the video sequence contains strong time domain correlation, the pixels of the adjacent coded images are used to predict the pixels of the current image, so as to effectively remove the temporal redundancy of the video. The inter prediction part of the main video coding standards all adopts block-based motion compensation technology. The main principle is to find the best matching block in the previous coded image for each pixel block of the current image. This process is called motion estimation (ME).
[0043] Motion Vector (MV): In inter-frame coding, a motion vector can be used to represent the relative displacement between the current coding block and the best matching block in its reference image. Each divided block has a corresponding motion vector that needs to be transmitted to the decoding end. If the motion vector of each block is independently encoded and transmitted, especially when it is divided into small-sized blocks, it will consume a considerable number of bits. In order to reduce the number of bits used to encode the motion vector, the spatial correlation between adjacent image blocks can be used to predict the motion vector of the current block to be encoded based on the motion vector of the adjacent encoded block, and then the prediction difference is encoded. In this way, the number of bits representing the motion vector can be effectively reduced. In the process of encoding the motion vector of the current block, first, the motion vector of the current block is predicted using the motion vector of the adjacent encoded block, and then the difference between the predicted value of the motion vector (MVP, Motion Vector Prediction) and the true estimate of the motion vector (MVD, Motion Vector Difference) can be encoded, thereby effectively reducing the number of encoding bits of the MV.
[0044] Motion Information: Since the motion vector represents the position offset between the current image block and a reference image block, in order to accurately obtain the information pointing to the image block, in addition to the motion vector, the index information of the reference frame image is also required to indicate which reference frame image to use. In video coding technology, for the current frame image, a reference frame image list can usually be established, and the reference frame image index information indicates which reference frame image in the reference frame image list is used by the current image block. In addition, many coding technologies also support multiple reference image lists, so an index value can also be used to indicate which reference image list is used. This index value can be called a reference direction. In video coding technology, motion-related information such as motion vectors, reference frame indexes, and reference directions can be collectively referred to as motion information.
[0045] Rate-Distortion Optimized: There are two major indicators for evaluating coding efficiency: bit rate and PSNR (Peak Signal to Noise Ratio). The smaller the bit stream, the greater the compression rate, and the greater the PSNR, the better the quality of the reconstructed image. When selecting a mode, the discriminant formula is essentially a comprehensive evaluation of the two. For example, the cost corresponding to the mode: J(mode) = D + λ*R, where D represents Distortion, which can usually be measured using the SSE indicator. SSE refers to the mean square sum of the differences between the reconstructed image block and the source image; λ is the Lagrange multiplier, and R is the actual number of bits required for encoding the image block in this mode, including the sum of bits required for encoding mode information, motion information, residuals, etc.
[0046] Video Coding Framework: See Figure 1 As shown, the video encoding framework can be used to implement the encoding end processing flow of the embodiment of the present application. In addition, the schematic diagram of the video decoding framework is similar to Figure 1 Similarly, no further description will be given here, and the decoding end processing flow of the embodiment of the present application can be implemented using a video decoding framework. Specifically, in the video encoding framework and the video decoding framework, modules such as intra-frame prediction, motion estimation / motion compensation, reference image buffer, in-loop filtering, reconstruction, transformation, quantization, inverse transformation, inverse quantization, and entropy encoder can be included. At the encoding end, the encoding end processing flow can be implemented through the cooperation between these modules, and at the decoding end, the decoding end processing flow can be implemented through the cooperation between these modules.
[0047] Flag coding: In video coding, there are many prediction modes, such as normal fusion mode, sub-block fusion mode, etc. For a certain block, a certain prediction mode may be adopted. In order to indicate which prediction mode is adopted, each block needs to encode the corresponding flag to mark it. That is, at the encoding end, the value of the flag can be determined, and then the flag is encoded and passed to the decoding end. At the decoding end, by parsing the flag, it is determined whether the corresponding prediction mode is enabled.
[0048] Merge mode: The fusion mode may include: normal fusion mode (i.e. Normal Merge mode), sub-block fusion mode (i.e. fusion mode using sub-block motion information, which may be referred to as Subblock fusion mode, referred to herein as Subblock fusion mode), MMVD mode (i.e. fusion mode for coding motion difference, which may be referred to as merge with MVD mode, referred to herein as MMVD mode), CIIP mode (i.e. fusion mode for jointly generating new prediction values by inter-frame and intra-frame prediction, which may be referred to as combine inter intra prediciton mode, referred to herein as CIIP mode), TPM mode (i.e. fusion mode for triangular prediction, which may be referred to as triangular prediction mode, referred to herein as TPM mode), GEO mode (i.e. fusion mode based on arbitrary geometric partitioning shape, which may be referred to as Geometrical Partitioning, referred to herein as GEO mode).
[0049] Skip mode: Skip mode is a special fusion mode. The difference between skip mode and fusion mode is that skip mode does not require coding residual. If the current block is in skip mode, CIIP mode is disabled by default, while normal fusion mode, sub-block fusion mode, MMVD mode, TPM mode, and GEO mode can still be applied.
[0050] Exemplarily, how to generate the prediction value can be determined based on the common fusion mode, sub-block fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, etc. After the prediction value is generated, for the fusion mode, the prediction value and the residual value can be used to obtain the reconstruction value; for the skip mode, there is no residual value, and the prediction value is directly used to obtain the reconstruction value.
[0051] Frame type: If the current frame cannot be encoded with reference to information from other frames, the current frame may be an I frame; if the current frame is allowed to be encoded with reference to information from one other frame (but not more than one frame), the current frame may be a P frame; if the current frame is allowed to be encoded with reference to information from one or two other frames, the current frame may be a B frame.
[0052] Sequence parameter set (SPS): In the sequence parameter set, there is a flag that determines whether certain tool switches are allowed in the entire sequence. If the flag is 1, the tool corresponding to the flag is allowed to be enabled in the video sequence; if the flag is 0, the tool corresponding to the flag is not allowed to be enabled in the encoding process in the video sequence.
[0053] Normal fusion mode: select one motion information from the candidate motion information list, and generate a prediction value of the current block based on the motion information. The candidate motion information list includes: candidate motion information of spatially adjacent blocks, candidate motion information of temporally adjacent blocks, candidate motion information of spatially non-adjacent blocks, motion information obtained by combining existing motion information, default motion information, etc.
[0054] MMVD mode: Based on the candidate motion information list of the common fusion mode, select one motion information from the candidate motion information list of the common fusion mode as the reference motion information, and obtain the motion information difference by table lookup. The final motion information is obtained based on the reference motion information and the motion information difference, and the prediction value of the current block is generated based on the final motion information.
[0055] Sub-block fusion mode: The sub-block fusion mode includes Affine fusion mode and sub-block TMVP mode.
[0056] Affine fusion mode is similar to normal fusion mode. It also selects a motion information from the candidate motion information list and generates the prediction value of the current block based on the motion information. Unlike normal fusion mode, the motion information in the candidate motion information list of normal fusion mode is a 2-parameter translation motion vector, while the motion information in the candidate motion information list of Affine fusion mode is 4-parameter Affine motion information, or 6-parameter Affine motion information.
[0057] In the subblock TMVP (subblock-based temporal motion vector prediction) mode, in the temporal reference frame, the motion information of a block is directly reused to generate the prediction value of the current block. The motion information of each subblock in the block may be different.
[0058] CIIP mode: obtains a new prediction value for the current block by combining the intra-frame prediction value and the inter-frame prediction value.
[0059] TPM mode: Divide a block into two triangular sub-blocks (there are two triangular sub-blocks of 45 degrees and 135 degrees). These two triangular sub-blocks have different unidirectional motion information. The TPM mode is only used for the prediction process and does not affect the subsequent transformation and quantization processes. The unidirectional motion information here is also directly obtained from the candidate motion information list.
[0060] GEO mode: GEO mode is similar to TPM mode, except for the different division shapes. GEO mode divides a square block into two sub-blocks of any shape (any other shape except the two triangular sub-blocks of TPM), such as a triangular sub-block and a pentagonal sub-block; or, a triangular sub-block and a quadrilateral sub-block; or, two trapezoidal sub-blocks, etc., without any restrictions on the division shape. The two sub-blocks divided by TPM mode have different unidirectional motion information.
[0061] It can be seen from the above examples that the fusion mode and skip mode involved in this embodiment refer to a type of prediction mode that directly selects a motion information from a candidate motion information list to generate a prediction value of the current block. These prediction modes do not require a motion search process at the encoding end. Except for the MMVD mode, other modes do not require encoding motion information differences.
[0062] In the related art, the encoding end needs to select a prediction mode from a plurality of prediction modes (such as normal fusion mode, MMVD mode, CIIP mode, TPM mode, sub-block fusion mode, etc.) as a target prediction mode. For example, the target prediction mode is a sub-block fusion mode, and the sub-block fusion mode is used to encode the current block. When the encoding end sends the encoded bit stream to the decoding end, the encoded bit stream may include indication information of the sub-block fusion mode, such as 0001, and 0001 is used to represent the sub-block fusion mode. After receiving the encoded bit stream, the decoding end parses the indication information 0001 from the encoded bit stream, determines that the target prediction mode is the sub-block fusion mode based on the indication information, and decodes the current block according to the sub-block fusion mode. However, the above method requires 4 bits to represent the sub-block fusion mode, the number of bits is large, the encoding overhead is large, and the encoding performance is poor.
[0063] For example, as shown in Table 1A, in order to save the overhead of encoding flag bits, the encoding of each flag bit often has some restrictions, and the corresponding flag bit is only encoded when certain limiting conditions are met. See Table 1B for an example of the flag bit of the fusion mode, and see Table 1C for an example of the flag bit of the skip mode. It can be seen from Table 1A that since there are restrictions on the encoding of the flag bit of each mode, a certain mode can only be enabled when all conditions are met, that is, its flag bit needs to be encoded, and these conditions can be known when encoding the first mode (i.e., the normal fusion mode). When encoding the previous flag bit, the encoding of the current mode flag bit can be skipped according to these conditions to save code rate overhead. It can be seen from Table 1B and Table 1C that the normal fusion mode only requires 1 bit, while the sub-block fusion mode requires 3 bits. According to the analysis of the inventor, the probability of using the sub-block fusion mode is often greater than the probability of using the normal fusion mode. Therefore, encoding the flag bit in the manner shown in Table 1B or Table 1C will result in a relatively large average code length for the flag bit encoding of these modes.
[0064] Table 1A
[0065]
[0066]
[0067] Table 1B
[0068] Normal fusion mode flag MMVD mode flag Sub-block fusion mode flag CIIP mode flag Normal fusion mode 1 - - - MMVD mode 0 1 - - Sub-block fusion mode 0 0 1 - CIIP Model 0 0 0 1 TPM Mode 0 0 0 0
[0069] Table 1C
[0070] Normal fusion mode flag MMVD mode flag Sub-block fusion mode flag Normal fusion mode 1 - - MMVD mode 0 1 - Sub-block fusion mode 0 0 1 TPM Mode 0 0 0
[0071] In view of the above findings, in an embodiment of the present application, the prediction mode with a higher probability of use is encoded first, and the prediction mode with a lower probability of use is encoded later, so that fewer flag encoding bits can be used as a whole. For example, assuming that the sub-block fusion mode is a prediction mode with a higher probability of use, the sub-block fusion mode can be represented by "1". Since the sub-block fusion mode is more likely to be used, the coded bit stream is likely to carry "1", thereby reducing the number of bits in the coded bit stream, reducing the coding overhead, and improving the coding performance. Assuming that the CIIP mode is a prediction mode with a lower probability of use, the CIIP mode can be represented by "0001". Obviously, since the CIIP mode is less likely to be used, the coded bit stream is less likely to carry "0001".
[0072] Since there are restrictions on the encoding of the flag bit of each prediction mode, a prediction mode can only be enabled when all conditions are met, that is, the flag bit needs to be encoded, and these conditions can be known when encoding the first prediction mode. When encoding the previous flag bit, the encoding of the flag bit of the current prediction mode can be skipped according to these conditions to save bit rate overhead.
[0073] For example, when encoding the normal fusion mode, assuming that based on the current conditions, it is known that the MMVD mode, CIIP mode, TPM mode, and sub-block fusion mode are not supported, the flag of the normal fusion mode can be not encoded. In this case, the decoder knows that based on the current conditions, the MMVD mode, CIIP mode, TPM mode, and sub-block fusion mode are not supported, so only the normal fusion mode can be enabled. In summary, there is no need to decode the flag of the normal fusion mode, and the decoder can deduce that the flag value of the normal fusion mode is 1, thereby reducing the number of bits in the encoded bit stream and improving the encoding performance.
[0074] The decoding method and encoding method of the embodiments of the present application are described below in combination with several specific embodiments.
[0075] Example 1: See Figure 2FIG. 1 is a flowchart of a decoding method, which can be applied to a decoding end. The method includes:
[0076] Step 201, determine the prediction mode flag information of the current block, and the prediction mode flag information includes the flag value of at least one candidate prediction mode among N candidate prediction modes. When the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled.
[0077] Step 201 is equivalent to determining the activation status of at least one of the N candidate prediction modes of the current block. The decoding end can determine the target prediction mode activated by the current block from the N candidate prediction modes according to the activation status of at least one of the N candidate prediction modes. The activation status of at least one of the N candidate prediction modes can be understood as the activation status of one or more of the N candidate prediction modes, and is not limited to the activation status of all candidate prediction modes.
[0078] Exemplarily, for any flag value of a candidate prediction mode included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag value may be read from the flag indication information of whether to enable the candidate prediction mode carried in the coded bit stream of the current block. If the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag value may be the derived flag value of the candidate prediction mode, and the derived flag value of the candidate prediction mode may be pre-configured at the encoding end and the decoding end.
[0079] Exemplarily, the first value may be 1, indicating that the candidate prediction mode is enabled, and the second value may be 0, indicating that the candidate prediction mode is not enabled; or conversely, the first value may be 0, indicating that the candidate prediction mode is enabled, and the second value may be 1, indicating that the candidate prediction mode is not enabled. Of course, the above are just examples and are not limited to this. For example, the first value may be a, and the second value may be b, etc. For the convenience of description, in the subsequent embodiments, the first value is 1 and the second value is 0 as an example, that is, the flag bit value of 1 in the subsequent embodiments refers to the flag bit value of the first value, and the flag bit value of 0 in the subsequent embodiments refers to the flag bit value of the second value.
[0080] Exemplarily, assuming that the prediction mode flag information includes flag values of three candidate prediction modes, the three candidate prediction modes may be respectively recorded as candidate prediction mode 1, candidate prediction mode 2 and candidate prediction mode 3.
[0081] For the flag value of candidate prediction mode 1, if the current block meets the decoding condition of the flag value of candidate prediction mode 1, the flag value is read from the flag indication information of whether candidate prediction mode 1 is enabled carried in the coded bit stream of the current block. For example, if the flag indication information of whether candidate prediction mode 1 is enabled carried in the coded bit stream includes a value of 0, the flag value of candidate prediction mode 1 is 0; if the flag indication information of whether candidate prediction mode 1 is enabled carried in the coded bit stream includes a value of 1, the flag value of candidate prediction mode 1 is 1. If the current block does not meet the decoding condition of the flag value of candidate prediction mode 1, the flag value is the derived flag value of candidate prediction mode 1. For example, the flag value of candidate prediction mode 1 is directly derived as 1 or 0.
[0082] For the flag value of candidate prediction mode 2, if the current block meets the decoding conditions of the flag value of candidate prediction mode 2, the flag value is read from the flag indication information of whether candidate prediction mode 2 is enabled carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of candidate prediction mode 2, the flag value is the derived flag value of candidate prediction mode 2. For the flag value of candidate prediction mode 3, if the current block meets the decoding conditions of the flag value of candidate prediction mode 3, the flag value is read from the flag indication information of whether candidate prediction mode 3 is enabled carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of candidate prediction mode 3, the flag value is the derived flag value of candidate prediction mode 3.
[0083] In a possible implementation, the N candidate prediction modes include but are not limited to at least one of the following: sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode. Of course, the above are only examples of candidate prediction modes, and there is no limitation on the candidate prediction modes, which can be any candidate prediction mode.
[0084] In a possible implementation manner, determining the prediction mode flag information of the current block may include, but is not limited to: determining the prediction mode flag information according to the acquisition order of flag values of N candidate prediction modes.
[0085] Exemplarily, if the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, and a CIIP mode, the order of obtaining the flag values of the N candidate prediction modes from front to back may be: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. Of course, the above is only an example, and other acquisition orders may also be used, without limitation. For example, the acquisition order may also be: the flag value of the normal fusion mode, the flag value of the sub-block fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. For another example, the acquisition order may also be: the flag value of the MMVD mode, the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, and the flag value of the CIIP mode.
[0086] Exemplarily, if the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a GEO mode, then the acquisition order of the flag values of the N candidate prediction modes can be, from front to back, the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode. Of course, the above is only an example, and other acquisition orders can also be used, without limitation. For example, the acquisition order can also be, from front to back, the flag value of the normal fusion mode, the flag value of the sub-block fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode.
[0087] Exemplarily, the N candidate prediction modes may also include other possibilities. For example, the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, and an MMVD mode. For another example, the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, and a CIIP mode. There is no limitation on these N candidate prediction modes and they can be set according to actual needs.
[0088] In a possible implementation, the prediction mode flag information is determined according to the order in which the flag values of the N candidate prediction modes are obtained, which may include but is not limited to the following methods: based on the order in which the flag values of the N candidate prediction modes are obtained, after obtaining the flag value of the current candidate prediction mode, it can be determined whether to obtain the flag value of the candidate prediction mode following the current candidate prediction mode based on the flag value of the current candidate prediction mode.
[0089] For example, it is assumed that the order of obtaining the flag values of the N candidate prediction modes is from front to back: the flag value of candidate prediction mode 1, the flag value of candidate prediction mode 2, and the flag value of candidate prediction mode 3. After obtaining the flag value of candidate prediction mode 1, it can be determined whether to obtain the flag value of candidate prediction mode 2 and the flag value of candidate prediction mode 3 according to the flag value of candidate prediction mode 1. After obtaining the flag value of candidate prediction mode 2, it is determined whether to obtain the flag value of candidate prediction mode 3 according to the flag value of candidate prediction mode 2.
[0090] For another example, assume that the order of obtaining the flag values of the N candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. After obtaining the flag value of the sub-block fusion mode, it can be determined whether to obtain the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode according to the flag value of the sub-block fusion mode. After obtaining the flag value of the common fusion mode, it can be determined whether to obtain the flag value of the MMVD mode and the flag value of the CIIP mode according to the flag value of the fusion mode, and so on, which will not be repeated here.
[0091] For the flag value of the sub-block fusion mode, if the current block meets the decoding condition of the flag value of the sub-block fusion mode, the flag value is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block. For example, if the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream includes a value of 0, the flag value of the sub-block fusion mode is 0; if the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream includes a value of 1, the flag value of the sub-block fusion mode is 1. If the current block does not meet the decoding condition of the flag value of the sub-block fusion mode, the flag value is the derived flag value of the sub-block fusion mode. For example, the flag value of the sub-block fusion mode is directly derived as 1 or 0. When the flag value of the sub-block fusion mode is 1, it is used to indicate that the sub-block fusion mode is enabled; when the flag value of the sub-block fusion mode is 0, it is used to indicate that the sub-block fusion mode is not enabled.
[0092] For the flag value of the normal fusion mode, if the current block meets the decoding conditions of the flag value of the normal fusion mode, the flag value is read from the flag indication information of whether the normal fusion mode is enabled carried in the coded bit stream of the current block. For example, if the flag indication information of whether the normal fusion mode is enabled carried in the coded bit stream includes a value of 0, the flag value of the normal fusion mode is 0; if the flag indication information of whether the normal fusion mode is enabled carried in the coded bit stream includes a value of 1, the flag value of the normal fusion mode is 1. If the current block does not meet the decoding conditions of the flag value of the normal fusion mode, the flag value is the derived flag value of the normal fusion mode. For example, the flag value of the normal fusion mode is directly derived as 1 or 0. When the flag value of the normal fusion mode is 1, it is used to indicate that the normal fusion mode is enabled; when the flag value of the normal fusion mode is 0, it is used to indicate that the normal fusion mode is not enabled.
[0093] For the flag value of the MMVD mode, if the current block meets the decoding conditions of the flag value of the MMVD mode, the flag value is read from the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream of the current block. For example, if the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream includes a value of 0, the flag value of the MMVD mode is 0; if the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream includes a value of 1, the flag value of the MMVD mode is 1. If the current block does not meet the decoding conditions of the flag value of the MMVD mode, the flag value is the derived flag value of the MMVD mode. For example, the flag value of the MMVD mode is directly derived as 1 or 0. When the flag value of the MMVD mode is 1, it is used to indicate that the MMVD mode is enabled; when the flag value of the MMVD mode is 0, it is used to indicate that the MMVD mode is not enabled.
[0094] For the flag value of the CIIP mode, if the current block meets the decoding condition of the flag value of the CIIP mode, the flag value can be read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block. For example, if the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream includes a value of 0, the flag value of the CIIP mode can be 0; if the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream includes a value of 1, the flag value of the CIIP mode can be 1. If the current block does not meet the decoding condition of the flag value of the CIIP mode, the flag value is the derived flag value of the CIIP mode. For example, the flag value of the CIIP mode is directly derived as 1 or 0. Exemplarily, when the flag value of the CIIP mode is 1, it is used to indicate that the CIIP mode is enabled; when the flag value of the CIIP mode is 0, it is used to indicate that the CIIP mode is not enabled.
[0095] For the flag value of the GEO mode, if the current block meets the decoding conditions of the flag value of the GEO mode, the flag value can be read from the flag indication information of whether the GEO mode is enabled carried in the coded bit stream of the current block. For example, if the flag indication information of whether the GEO mode is enabled carried in the coded bit stream includes a value of 0, the flag value of the GEO mode can be 0; if the flag indication information of whether the GEO mode is enabled carried in the coded bit stream includes a value of 1, the flag value of the GEO mode can be 1. If the current block does not meet the decoding conditions of the flag value of the GEO mode, the flag value is the derived flag value of the GEO mode. For example, the flag value of the GEO mode is directly derived as 1 or 0. Exemplarily, when the flag value of the GEO mode is 1, it is used to indicate that the GEO mode is enabled; when the flag value of the GEO mode is 0, it is used to indicate that the GEO mode is not enabled.
[0096] Step 202: determine the target prediction mode enabled for the current block according to the prediction mode flag information.
[0097] For the decoding end, based on the prediction mode flag information, the activation status of one or more candidate prediction modes among N candidate prediction modes can be obtained, and then based on the activation status of these candidate prediction modes and the pre-configured strategy, it is determined which candidate prediction mode is the target prediction mode of the current block.
[0098] Step 203: decode the current block according to the target prediction mode, and there is no restriction on the decoding process.
[0099] It can be seen from the above scheme that in the embodiment of the present application, when determining the prediction mode flag information of the current block, for the flag value of each candidate prediction mode, if the current block does not meet the decoding conditions of the flag value of the candidate prediction mode, then the flag value is the derived flag value of the candidate prediction mode, rather than being parsed from the encoded bit stream, that is, there is no need to carry the flag value of the candidate prediction mode in the encoded bit stream, thereby reducing the number of bits in the encoded bit stream, reducing encoding overhead, improving encoding performance, simplifying the process of decoding the prediction mode, and improving the efficiency of decoding the prediction mode.
[0100] Example 2: See Figure 3 FIG. 1 is a flow chart of an encoding method, which can be applied to an encoding end. The method includes:
[0101] Step 301 : determining a target prediction mode enabled for a current block, where the target prediction mode is one of N candidate prediction modes for the current block.
[0102] Exemplarily, the encoder can determine all candidate prediction modes supported by the current block, such as sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, etc. Then, the encoder traverses each candidate prediction mode supported by the current block and determines the rate-distortion cost value of the candidate prediction mode, and the method for determining the rate-distortion cost value is not limited. Then, the encoder uses the candidate prediction mode with the smallest rate-distortion cost value as the target prediction mode.
[0103] Of course, the above method for determining the target prediction mode is only an example and is not limited thereto. For example, the encoder may arbitrarily select a candidate prediction mode as the target prediction mode, or adopt other methods, which will not be described in detail here.
[0104] Step 302, according to the target prediction mode, determine the prediction mode flag information of the current block, the prediction mode flag information includes the flag value of at least one candidate prediction mode among N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled.
[0105] For the encoding end, after determining the target prediction mode, it is necessary to clarify which candidate prediction modes among the N candidate prediction modes need to be informed to the decoding end about their activation status. After determining whether one or more candidate prediction modes among the N candidate prediction modes are enabled and need to be informed to the decoding end, whether these related candidate prediction modes are enabled is encoded according to a certain strategy, so that the decoding end can determine the target prediction mode from the N candidate prediction modes based on the activation status of one or more candidate prediction modes among the N candidate prediction modes according to the same strategy.
[0106] Exemplarily, the first value may be 1 and the second value may be 0; or, the first value may be 0 and the second value may be 1. Of course, the above is only an example and is not limited thereto. For example, the first value may be a and the second value may be b, etc. For the convenience of description, in the subsequent embodiments, the first value is 1 and the second value is 0 as an example, that is, the flag bit value 1 in the subsequent embodiments refers to the flag bit value being the first value, and the flag bit value 0 in the subsequent embodiments refers to the flag bit value being the second value.
[0107] Step 303, encode the current block according to the prediction mode flag information, and there is no restriction on this encoding process. In the process of encoding the current block, for each candidate prediction mode flag value included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether to enable the candidate prediction mode is carried in the encoded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether to enable the candidate prediction mode is not carried in the encoded bit stream of the current block.
[0108] Exemplarily, assuming that the prediction mode flag information includes flag values of three candidate prediction modes, the three candidate prediction modes may be respectively recorded as candidate prediction mode 1, candidate prediction mode 2 and candidate prediction mode 3.
[0109] For the flag value of candidate prediction mode 1, if the current block meets the decoding condition of the flag value of candidate prediction mode 1, the flag indication information of whether candidate prediction mode 1 is enabled is carried in the coded bit stream of the current block. For example, if the flag value of candidate prediction mode 1 is 1, the flag indication information of candidate prediction mode 1 carried in the coded bit stream of the current block is 1; if the flag value of candidate prediction mode 1 is 0, the flag indication information of candidate prediction mode 1 carried in the coded bit stream of the current block is 0. If the current block does not meet the decoding condition of the flag value of candidate prediction mode 1, the flag indication information of whether candidate prediction mode 1 is enabled is not carried in the coded bit stream of the current block. For example, regardless of whether the flag value of candidate prediction mode 1 is 0 or 1, the flag indication information of candidate prediction mode 1 is not carried in the coded bit stream, but the flag value of candidate prediction mode 1 is derived by the decoding end itself.
[0110] For the flag value of candidate prediction mode 2, if the current block meets the decoding conditions of the flag value of candidate prediction mode 2, the flag indication information of whether candidate prediction mode 2 is enabled is carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of candidate prediction mode 2, the flag indication information of whether candidate prediction mode 2 is enabled is not carried in the coded bit stream of the current block. For the flag value of candidate prediction mode 3, if the current block meets the decoding conditions of the flag value of candidate prediction mode 3, the flag indication information of whether candidate prediction mode 3 is enabled is carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of candidate prediction mode 3, the flag indication information of whether candidate prediction mode 3 is enabled is not carried in the coded bit stream of the current block.
[0111] In a possible implementation, the N candidate prediction modes include but are not limited to at least one of the following: sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode. Of course, the above are only examples of candidate prediction modes, and there is no limitation on the candidate prediction modes, which can be any candidate prediction mode.
[0112] In a possible implementation manner, a decision may be made whether to carry flag indication information of whether to enable a candidate prediction mode in the coded bit stream of the current block according to the order in which the flag values of the N candidate prediction modes are obtained.
[0113] Exemplarily, if the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, and a CIIP mode, the order of obtaining the flag values of the N candidate prediction modes from front to back may be: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. Of course, the above is only an example, and other acquisition orders may also be used, and this acquisition order is not limited.
[0114] If the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a GEO mode, then the order of obtaining the flag values of the N candidate prediction modes from front to back can be: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode. Of course, the above is only an example, and other acquisition orders can also be used, and there is no limitation on this.
[0115] Of course, the N candidate prediction modes may also include other possibilities. For example, the N candidate prediction modes include sub-block fusion mode, normal fusion mode, and MMVD mode. For another example, the N candidate prediction modes include sub-block fusion mode, normal fusion mode, and CIIP mode. There is no restriction on these N candidate prediction modes and they can be set according to actual needs.
[0116] In a possible implementation, deciding whether to carry flag indication information of whether to enable a candidate prediction mode in the coded bit stream of the current block according to the order in which the flag values of the N candidate prediction modes are obtained may include: based on the order in which the flag values of the N candidate prediction modes are obtained, and according to the flag value of the current candidate prediction mode, deciding whether to carry flag indication information of the candidate prediction mode following the current candidate prediction mode in the coded bit stream of the current block.
[0117] For example, it is assumed that the order of obtaining the flag values of the N candidate prediction modes is from front to back: the flag value of candidate prediction mode 1, the flag value of candidate prediction mode 2, and the flag value of candidate prediction mode 3. According to the flag value of candidate prediction mode 1, it is decided whether to carry the flag indication information of candidate prediction mode 2 and the flag indication information of candidate prediction mode 3 in the coded bit stream of the current block. According to the flag value of candidate prediction mode 2, it is decided whether to carry the flag indication information of candidate prediction mode 3 in the coded bit stream of the current block. For another example, it is assumed that the order of obtaining the flag values of the N candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the ordinary fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. According to the flag value of the sub-block fusion mode, it is decided whether to carry the flag indication information of the ordinary fusion mode, the flag indication information of the MMVD mode, and the flag indication information of the CIIP mode in the coded bit stream of the current block. According to the flag value of the common fusion mode, it is decided whether to carry the MMVD mode's bit indication information, the CIIP mode's bit indication information, and so on in the coded bit stream of the current block.
[0118] For the flag value of the sub-block fusion mode, if the current block meets the decoding condition of the flag value of the sub-block fusion mode, the flag indication information of whether the sub-block fusion mode is enabled is carried in the coded bit stream of the current block. For example, if the flag value of the sub-block fusion mode is 1, the flag indication information of the sub-block fusion mode is 1; if the flag value of the sub-block fusion mode is 0, the flag indication information of the sub-block fusion mode is 0. If the current block does not meet the decoding condition of the flag value of the sub-block fusion mode, the flag indication information of whether the sub-block fusion mode is enabled is not carried in the coded bit stream of the current block.
[0119] For the flag value of the normal fusion mode, if the current block meets the decoding conditions of the flag value of the normal fusion mode, the flag indication information of whether the normal fusion mode is enabled is carried in the coded bit stream of the current block. For example, if the flag value of the normal fusion mode is 1, the flag indication information of the normal fusion mode is 1; if the flag value of the normal fusion mode is 0, the flag indication information of the normal fusion mode is 0. If the current block does not meet the decoding conditions of the flag value of the normal fusion mode, the flag indication information of whether the normal fusion mode is enabled is not carried in the coded bit stream of the current block.
[0120] For the flag value of the MMVD mode, if the current block meets the decoding conditions of the flag value of the MMVD mode, the flag indication information of whether the MMVD mode is enabled is carried in the coded bit stream of the current block. For example, if the flag value of the MMVD mode is 1, the flag indication information of the MMVD mode is 1; if the flag value of the MMVD mode is 0, the flag indication information of the MMVD mode is 0. If the current block does not meet the decoding conditions of the flag value of the MMVD mode, the flag indication information of whether the MMVD mode is enabled is not carried in the coded bit stream of the current block.
[0121] For the flag value of the CIIP mode, if the current block meets the decoding conditions of the flag value of the CIIP mode, the flag indication information of whether the CIIP mode is enabled is carried in the coded bit stream of the current block. For example, if the flag value of the CIIP mode is 1, the flag indication information of the CIIP mode is 1; if the flag value of the CIIP mode is 0, the flag indication information of the CIIP mode is 0. If the current block does not meet the decoding conditions of the flag value of the CIIP mode, the flag indication information of whether the CIIP mode is enabled is not carried in the coded bit stream of the current block.
[0122] For the flag value of the GEO mode, if the current block meets the decoding conditions of the flag value of the GEO mode, the flag indication information of whether the GEO mode is enabled is carried in the coded bit stream of the current block. For example, if the flag value of the GEO mode is 1, the flag indication information of the GEO mode is 1; if the flag value of the GEO mode is 0, the flag indication information of the GEO mode is 0. If the current block does not meet the decoding conditions of the flag value of the GEO mode, the flag indication information of whether the GEO mode is enabled is not carried in the coded bit stream of the current block.
[0123] It can be seen from the above scheme that in the embodiment of the present application, for the flag value of each candidate prediction mode, if the current block does not meet the decoding conditions of the flag value of the candidate prediction mode, the flag indication information of whether to enable the candidate prediction mode is no longer carried in the encoded bit stream of the current block, thereby reducing the number of bits in the encoded bit stream, reducing the encoding overhead, improving the encoding performance, simplifying the process of decoding the prediction mode, and improving the efficiency of the decoding prediction mode.
[0124] The decoding method of embodiment 1 and the encoding method of embodiment 2 can be applied to the encoding and decoding process of the fusion mode, and can also be applied to the encoding and decoding process of the skip mode. Referring to the above embodiments, the fusion mode may include but is not limited to: sub-block fusion mode, normal fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode. The skip mode may include but is not limited to: sub-block fusion mode, normal fusion mode, MMVD mode, TPM mode, GEO mode.
[0125] In the merge mode or skip mode, the decoding method of embodiment 1 may be used to determine the target prediction mode, and the current block may be decoded according to the target prediction mode. For the specific process, see embodiment 1. The encoding method of embodiment 2 may be used to determine the target prediction mode, and the current block may be encoded according to the target prediction mode. For the specific process, see embodiment 2.
[0126] The above decoding method and encoding method are further described below in conjunction with several specific embodiments.
[0127] Example 3: See Figure 4A , which is a schematic diagram of a method for encoding and decoding a prediction mode flag.
[0128] In this embodiment, the candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a TPM mode. The order of obtaining the flag values of the candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0129] When determining the prediction mode flag information of the current block, the prediction mode flag information includes one or more of the flag values of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. For example, the decoding end obtains the flag values of each prediction mode in the following manner:
[0130] Get the flag value of the sub-block fusion mode. If the current block meets the decoding conditions of the flag value of the sub-block fusion mode, the flag value is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of the sub-block fusion mode, the flag value is derived.
[0131] If the flag value of the sub-block merging mode is 1, the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block merging mode.
[0132] If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode is obtained. If the current block meets the decoding conditions of the flag value of the normal fusion mode, the flag value of the normal fusion mode is read from the flag indication information of whether the normal fusion mode is enabled carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of the normal fusion mode, the flag value of the normal fusion mode is derived.
[0133] If the flag value of the common fusion mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the sub-block fusion mode and the flag value of the common fusion mode.
[0134] If the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is obtained. If the current block meets the decoding conditions of the flag value of the MMVD mode, the flag value of the MMVD mode is read from the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of the MMVD mode, the flag value of the MMVD mode is derived.
[0135] If the flag value of the MMVD mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the common fusion mode, and the flag value of the MMVD mode.
[0136] If the flag value of the MMVD mode is 0, then continue to obtain the flag value of the CIIP mode. If the current block meets the decoding conditions of the flag value of the CIIP mode, the flag value of the CIIP mode is read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block. If the current block does not meet the decoding conditions of the flag value of the CIIP mode, the flag value of the CIIP mode is derived.
[0137] After obtaining the flag value of the CIIP mode, the flag value acquisition process is terminated, and the prediction mode flag information may include the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0138] In the above embodiment, the decoding end needs to determine whether the current block meets the decoding conditions of the flag value of the prediction mode, and decide based on the judgment result whether the flag value is read from the encoded bit stream of the current block or derived.
[0139] See Table 2, which is an example of decoding conditions for flag values of each prediction mode.
[0140] Table 2
[0141]
[0142] As can be seen from Table 2, in a possible implementation manner, the decoding condition of the flag value of the sub-block fusion mode includes the support of the current block for the sub-block fusion mode, and the method for obtaining the flag value of the sub-block fusion mode includes: if the current block supports the sub-block fusion mode, then the flag value of the sub-block fusion mode is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block, for example, when the flag indication information of the sub-block fusion mode is 0, the flag value of the sub-block fusion mode is 0, and when the flag indication information of the sub-block fusion mode is 1, the flag value of the sub-block fusion mode is 1. Otherwise, it is derived that the flag value of the sub-block fusion mode is 0.
[0143] In a possible implementation, the decoding condition of the flag value of the common fusion mode includes the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the common fusion mode includes: if the current block supports the MMVD mode, or the current block supports the CIIP mode, or the current block supports the TPM mode, then the flag value of the common fusion mode is read from the flag indication information of whether the common fusion mode is enabled carried in the coded bit stream of the current block, for example, when the flag indication information of the common fusion mode is 0, the flag value of the common fusion mode is 0, and when the flag indication information of the common fusion mode is 1, the flag value of the common fusion mode is 1. Otherwise, it is deduced that the flag value of the common fusion mode is 1.
[0144] In a possible implementation, the decoding condition of the flag value of the MMVD mode may include the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the MMVD mode may include: if the current block supports the MMVD mode and the current block supports the CIIP mode, or the current block supports the MMVD mode and the current block supports the TPM mode, then the flag value of the MMVD mode is read from the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream of the current block, for example, when the flag indication information of the MMVD mode is 0, the flag value of the MMVD mode is 0, and when the flag indication information of the MMVD mode is 1, the flag value of the MMVD mode is 1. Otherwise, when the current block supports the MMVD mode, it can be deduced that the flag value of the MMVD mode is 1, and when the current block does not support the MMVD mode, it can be deduced that the flag value of the MMVD mode is 0.
[0145] In a possible implementation, the decoding condition of the flag value of the CIIP mode includes the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the CIIP mode may include: if the current block supports the CIIP mode and the current block supports the TPM mode, then the flag value of the CIIP mode is read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block, for example, when the flag indication information of the CIIP mode is 0, the flag value of the CIIP mode is 0, and when the flag indication information of the CIIP mode is 1, the flag value of the CIIP mode is 1. Otherwise, when the current block supports the CIIP mode, the flag value of the CIIP mode is derived to be 1, and when the current block does not support the CIIP mode, the flag value of the CIIP mode is derived to be 0.
[0146] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4AAs shown, if the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the sub-block fusion mode is 0, and the flag value of the ordinary fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the ordinary fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode.
[0147] In a possible implementation manner, corresponding to the above processing flow of the decoding end, for the encoding end, the encoding end first determines the target prediction mode. The specific determination method is shown in Example 2 and will not be described in detail here. Then, the prediction mode flag information of the current block is determined according to the target prediction mode, see Example 2. Figure 4A As shown, assuming that the target prediction mode is the normal fusion mode, the prediction mode flag information includes: the flag value of the sub-block fusion mode is 0, and the flag value of the normal fusion mode is 1.
[0148] For the flag value of the sub-block fusion mode 0, if the current block meets the decoding condition of the flag value of the sub-block fusion mode, the flag indication information of whether the sub-block fusion mode is enabled is carried in the coded bit stream of the current block, that is, the flag indication information of the sub-block fusion mode is 1. If the current block does not meet the decoding condition of the flag value of the sub-block fusion mode, the flag indication information of whether the sub-block fusion mode is enabled is not carried in the coded bit stream of the current block.
[0149] For the flag value of the normal fusion mode, 1, if the current block meets the decoding conditions of the flag value of the normal fusion mode, the flag indication information of whether the normal fusion mode is enabled is carried in the coded bit stream of the current block, that is, the flag indication information of the normal fusion mode is 1. If the current block does not meet the decoding conditions of the flag value of the normal fusion mode, the flag indication information of whether the normal fusion mode is enabled is not carried in the coded bit stream of the current block.
[0150] By analogy, the flag value of each prediction mode in the prediction mode flag information is processed in the above manner, which will not be described in detail here. When the prediction mode flag information is other cases, the processing method is similar, which will not be described in detail here.
[0151] Example 4: See Figure 4B , which is a schematic diagram of a method for encoding and decoding a prediction mode flag.
[0152] In this embodiment, the candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a TPM mode. The order of obtaining the flag values of the candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0153] When determining the prediction mode flag information of the current block, the prediction mode flag information includes one or more of the flag values of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode. For example, the decoding end obtains the flag values of each prediction mode in the following manner:
[0154] Get the flag value of the sub-block fusion mode.
[0155] If the flag value of the sub-block merging mode is 1, the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block merging mode.
[0156] If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode continues to be obtained.
[0157] If the flag value of the normal fusion mode is 1, the flag value of the MMVD mode continues to be obtained, and the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, and the flag value of the MMVD mode.
[0158] If the flag value of the normal fusion mode is 0, the flag value of the CIIP mode is continued to be obtained, and the flag value acquisition process is terminated. In this case, the prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, and the flag value of the CIIP mode.
[0159] In the above embodiment, when the decoding end obtains the flag value, if the current block meets the decoding condition of the flag value of the prediction mode, the flag value is read from the coded bit stream of the current block. If the current block does not meet the decoding condition of the flag value of the prediction mode, the flag value is derived. Therefore, it is necessary to determine whether the current block meets the decoding condition of the flag value of the prediction mode. See Table 3 for an example of the decoding condition of the flag value of each prediction mode.
[0160] Table 3
[0161]
[0162] As can be seen from Table 3, in a possible implementation manner, the decoding condition of the flag value of the sub-block fusion mode includes the support of the current block for the sub-block fusion mode, and the method for obtaining the flag value of the sub-block fusion mode includes: if the current block supports the sub-block fusion mode, the flag value of the sub-block fusion mode is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block. Otherwise, the flag value of the sub-block fusion mode is derived to be 0.
[0163] In a possible implementation, the decoding conditions for the flag value of the normal fusion mode may include the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the normal fusion mode may include but is not limited to: if the current block supports the CIIP mode, or the current block supports the TPM mode, then the flag value of the normal fusion mode is read from the flag indication information of whether the normal fusion mode is enabled carried in the encoded bit stream of the current block; otherwise, the flag value of the normal fusion mode is derived to be 1.
[0164] In a possible implementation, the decoding conditions for the flag value of the MMVD mode include the support of the current block for the MMVD mode, and the method for obtaining the flag value of the MMVD mode may include: if the current block supports the MMVD mode, reading the flag value of the MMVD mode from the flag indication information of whether the MMVD mode is enabled carried in the encoded bit stream of the current block; otherwise, deriving the flag value of the MMVD mode as 0.
[0165] The decoding condition of the flag value of the CIIP mode includes the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the CIIP mode may include: if the current block supports the CIIP mode and the current block supports the TPM mode, then the flag value of the CIIP mode is read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the CIIP mode, the flag value of the CIIP mode is derived to be 1, and when the current block does not support the CIIP mode, the flag value of the CIIP mode is derived to be 0.
[0166] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4BAs shown, if the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 1, and the flag value of the MMVD mode is 0, it is determined that the target prediction mode enabled by the current block is the ordinary fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 1, and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the CIIP mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode.
[0167] In a possible implementation manner, corresponding to the above processing flow of the decoding end, for the encoding end, the encoding end first determines the target prediction mode, and determines the prediction mode flag information of the current block according to the target prediction mode, see Figure 4B As shown, assuming that the target prediction mode is the normal fusion mode, the prediction mode flag information includes: the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode is 1, and the flag value of the MMVD mode is 0.
[0168] For other implementation processes, refer to the above-mentioned embodiment 3, except that the decoding conditions are shown in Table 3, which will not be repeated here.
[0169] Example 5: See Figure 4C , which is a schematic diagram of a method for encoding and decoding a prediction mode flag.
[0170] In this embodiment, the candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a TPM mode. The order of obtaining the flag values of the candidate prediction modes is from front to back: the flag value of the normal fusion mode, the flag value of the sub-block fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0171] When determining the prediction mode flag information of the current block, the prediction mode flag information includes one or more of the flag values of the common fusion mode, the flag values of the sub-block fusion mode, the flag values of the MMVD mode, and the flag values of the CIIP mode. For example, the decoding end obtains the flag values of each prediction mode in the following manner:
[0172] Get the flag value of the normal fusion mode.
[0173] If the flag value of the normal fusion mode is 1, the flag value of the sub-block fusion mode is obtained, and the flag value obtaining process is terminated. In this case, the prediction mode flag information includes the flag value of the normal fusion mode and the flag value of the sub-block fusion mode.
[0174] If the flag value of the normal fusion mode is 0, continue to obtain the flag value of the MMVD mode.
[0175] If the flag value of the MMVD mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the common fusion mode and the flag value of the MMVD mode.
[0176] If the flag value of the MMVD mode is 0, continue to obtain the flag value of the CIIP mode, and end the flag value acquisition process. In this case, the prediction mode flag information includes the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0177] In the above embodiment, when the decoding end obtains the flag value, if the current block meets the decoding condition of the flag value of the prediction mode, the flag value is read from the coded bit stream of the current block. If the current block does not meet the decoding condition of the flag value of the prediction mode, the flag value is derived. Therefore, it is necessary to determine whether the current block meets the decoding condition of the flag value of the prediction mode. See Table 4 for an example of the decoding condition of the flag value of each prediction mode.
[0178] Table 4
[0179]
[0180] It can be seen from Table 4 that in a possible implementation manner, the decoding conditions for the flag value of the normal fusion mode may include the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the normal fusion mode may include but is not limited to: if the current block supports the MMVD mode, or the current block supports the CIIP mode, or the current block supports the TPM mode, then the flag value of the normal fusion mode is read from the flag indication information of whether the normal fusion mode is enabled carried in the encoded bit stream of the current block; otherwise, it can be deduced that the flag value of the normal fusion mode is 1.
[0181] In a possible implementation, the decoding condition of the flag value of the sub-block fusion mode includes the support of the current block for the sub-block fusion mode, and the method for obtaining the flag value of the sub-block fusion mode includes: if the current block supports the sub-block fusion mode, reading the flag value of the sub-block fusion mode from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block. Otherwise, deriving the flag value of the sub-block fusion mode as 0.
[0182] In a possible implementation, the decoding condition of the flag value of the MMVD mode includes the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the MMVD mode includes: if the current block supports the MMVD mode and the current block supports the CIIP mode, or the current block supports the MMVD mode and the current block supports the TPM mode, then the flag value of the MMVD mode is read from the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the MMVD mode, it can be deduced that the flag value of the MMVD mode is 1, and when the current block does not support the MMVD mode, it can be deduced that the flag value of the MMVD mode is 0.
[0183] The decoding condition of the flag value of the CIIP mode includes the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the CIIP mode may include: if the current block supports the CIIP mode and the current block supports the TPM mode, then the flag value of the CIIP mode is read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the CIIP mode, the flag value of the CIIP mode is derived to be 1, and when the current block does not support the CIIP mode, the flag value of the CIIP mode is derived to be 0.
[0184] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4CAs shown, if the flag value of the normal fusion mode is 1 and the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the normal fusion mode is 1 and the flag value of the sub-block fusion mode is 0, it is determined that the target prediction mode enabled by the current block is the normal fusion mode. If the flag value of the normal fusion mode is 0 and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode.
[0185] In a possible implementation manner, corresponding to the above processing flow of the decoding end, for the encoding end, the encoding end first determines the target prediction mode, and determines the prediction mode flag information of the current block according to the target prediction mode, see Figure 4C As shown, assuming that the target prediction mode is the normal fusion mode, the prediction mode flag information includes: the flag value of the normal fusion mode is 1, and the flag value of the sub-block fusion mode is 0.
[0186] For other implementation processes, refer to the above-mentioned embodiment 3, except that the decoding conditions are shown in Table 4, which will not be described in detail here.
[0187] Example 6: See Figure 4D , which is a schematic diagram of a method for encoding and decoding a prediction mode flag.
[0188] In this embodiment, the candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a TPM mode. The order of obtaining the flag values of the candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the MMVD mode, the flag value of the normal fusion mode, and the flag value of the CIIP mode.
[0189] When determining the prediction mode flag information of the current block, the prediction mode flag information includes one or more of the flag values of the sub-block fusion mode, the flag value of the MMVD mode, the flag value of the common fusion mode, and the flag value of the CIIP mode. For example, the decoding end obtains the flag values of each prediction mode in the following manner:
[0190] Get the flag value of the sub-block fusion mode.
[0191] If the flag value of the sub-block fusion mode is 1, the flag value of the MMVD mode continues to be obtained, and the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block fusion mode and the flag value of the MMVD mode.
[0192] If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode continues to be obtained.
[0193] If the flag value of the common fusion mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the sub-block fusion mode and the flag value of the common fusion mode.
[0194] If the flag value of the normal fusion mode is 0, continue to obtain the flag value of the CIIP mode, and end the flag value acquisition process. In this case, the prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, and the flag value of the CIIP mode.
[0195] In the above embodiment, when the decoding end obtains the flag value, if the current block meets the decoding condition of the flag value of the prediction mode, the flag value is read from the coded bit stream of the current block. If the current block does not meet the decoding condition of the flag value of the prediction mode, the flag value is derived. Therefore, it is necessary to determine whether the current block meets the decoding condition of the flag value of the prediction mode. See Table 5 for an example of the decoding condition of the flag value of each prediction mode.
[0196] Table 5
[0197]
[0198]
[0199] It can be seen from Table 5 that in a possible implementation manner, the decoding condition of the flag value of the sub-block fusion mode includes the support of the current block for the sub-block fusion mode and the support of the current block for the MMVD mode. The method for obtaining the flag value of the sub-block fusion mode may include: if the current block supports the sub-block fusion mode and the current block supports the MMVD mode, the flag value of the sub-block fusion mode is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the sub-block fusion mode, the flag value of the sub-block fusion mode is derived to be 1, and when the current block does not support the sub-block fusion mode, the flag value of the sub-block fusion mode is derived to be 0.
[0200] In a possible implementation, the decoding conditions for the flag value of the MMVD mode include the support of the current block for the sub-block fusion mode and the support of the current block for the MMVD mode. The method for obtaining the flag value of the MMVD mode may include: if the current block supports the sub-block fusion mode and the current block supports the MMVD mode, then reading the flag value of the MMVD mode from the flag indication information of whether the MMVD mode is enabled carried in the encoded bit stream of the current block; otherwise, when the current block supports the MMVD mode, it is deduced that the flag value of the MMVD mode is 1; when the current block does not support the MMVD mode, it is deduced that the flag value of the MMVD mode is 0.
[0201] In a possible implementation, the decoding conditions for the flag value of the normal fusion mode may include the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the normal fusion mode may include but is not limited to: if the current block supports the CIIP mode, or the current block supports the TPM mode, then the flag value of the normal fusion mode is read from the flag indication information of whether the normal fusion mode is enabled carried in the encoded bit stream of the current block; otherwise, the flag value of the normal fusion mode is derived to be 1.
[0202] The decoding condition of the flag value of the CIIP mode includes the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the CIIP mode may include: if the current block supports the CIIP mode and the current block supports the TPM mode, then the flag value of the CIIP mode is read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the CIIP mode, the flag value of the CIIP mode is derived to be 1, and when the current block does not support the CIIP mode, the flag value of the CIIP mode is derived to be 0.
[0203] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4DAs shown, if the flag value of the sub-block fusion mode is 1 and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the sub-block fusion mode is 1 and the flag value of the MMVD mode is 0, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the sub-block fusion mode is 0 and the flag value of the ordinary fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the ordinary fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the CIIP mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode.
[0204] In a possible implementation manner, corresponding to the above processing flow of the decoding end, for the encoding end, the encoding end first determines the target prediction mode, and determines the prediction mode flag information of the current block according to the target prediction mode, see Figure 4D As shown, assuming that the target prediction mode is the normal fusion mode, the prediction mode flag information includes: the flag value of the sub-block fusion mode is 0, and the flag value of the normal fusion mode is 1.
[0205] For other implementation processes, refer to the above-mentioned embodiment 3, except that the decoding conditions are shown in Table 5, which will not be repeated here.
[0206] Example 7: See Figure 4E , which is a schematic diagram of a method for encoding and decoding a prediction mode flag.
[0207] In this embodiment, the candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a TPM mode. The order of obtaining the flag values of the candidate prediction modes is from front to back: the flag value of the normal fusion mode, the flag value of the sub-block fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0208] When determining the prediction mode flag information of the current block, the prediction mode flag information includes one or more of the flag values of the common fusion mode, the flag values of the sub-block fusion mode, the flag values of the MMVD mode, and the flag values of the CIIP mode. For example, the decoding end obtains the flag values of each prediction mode in the following manner:
[0209] Get the flag value of the normal fusion mode.
[0210] If the flag value of the normal fusion mode is 1, the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the normal fusion mode.
[0211] If the flag value of the normal fusion mode is 0, continue to obtain the flag value of the sub-block fusion mode.
[0212] If the flag value of the sub-block fusion mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the common fusion mode and the flag value of the sub-block fusion mode.
[0213] If the flag value of the sub-block fusion mode is 0, continue to obtain the flag value of the MMVD mode.
[0214] If the flag value of the MMVD mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the common fusion mode, the flag value of the sub-block fusion mode, and the flag value of the MMVD mode.
[0215] If the flag value of the MMVD mode is 0, the flag value of the CIIP mode is continued to be obtained, and the flag value acquisition process is ended. The prediction mode flag information includes the flag value of the common fusion mode, the flag value of the sub-block fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0216] In the above embodiment, when the decoding end obtains the flag value, if the current block meets the decoding condition of the flag value of the prediction mode, the flag value is read from the coded bit stream of the current block. If the current block does not meet the decoding condition of the flag value of the prediction mode, the flag value is derived. Therefore, it is necessary to determine whether the current block meets the decoding condition of the flag value of the prediction mode. See Table 6 for an example of the decoding condition of the flag value of each prediction mode.
[0217] Table 6
[0218]
[0219] In a possible implementation, the decoding conditions for the flag value of the normal fusion mode include the support of the current block for the sub-block fusion mode, the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the normal fusion mode includes: if the current block supports the sub-block fusion mode, or the current block supports the MMVD mode, or the current block supports the CIIP mode, or the current block supports the TPM mode, then the flag value of the normal fusion mode is read from the flag indication information of whether the normal fusion mode is enabled carried in the encoded bit stream of the current block; otherwise, the flag value of the normal fusion mode is derived to be 1.
[0220] In a possible implementation manner, the decoding condition of the flag value of the sub-block fusion mode includes the support of the current block for the sub-block fusion mode, the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the sub-block fusion mode includes: if the current block supports the sub-block fusion mode and the current block supports the MMVD mode; or the current block supports the sub-block fusion mode and the current block supports the CIIP mode, or the current block supports the sub-block fusion mode and the current block supports the TPM mode, then the flag value of the sub-block fusion mode is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the sub-block fusion mode, it can be deduced that the flag value of the sub-block fusion mode is 1, and when the current block does not support the sub-block fusion mode, it can be deduced that the flag value of the sub-block fusion mode is 0.
[0221] In a possible implementation, the decoding condition of the flag value of the MMVD mode includes the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The method for obtaining the flag value of the MMVD mode includes: if the current block supports the MMVD mode and the current block supports the CIIP mode, or the current block supports the MMVD mode and the current block supports the TPM mode, then the flag value of the MMVD mode is read from the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the MMVD mode, it can be deduced that the flag value of the MMVD mode is 1, and when the current block does not support the MMVD mode, it can be deduced that the flag value of the MMVD mode is 0.
[0222] The decoding conditions of the flag value of the CIIP mode include the support of the current block for the CIIP mode, the support of the current block for the TPM mode, and the method for obtaining the flag value of the CIIP mode, including: if the current block supports the CIIP mode and the current block supports the TPM mode, then the flag value of the CIIP mode is read from the flag indication information of whether the CIIP mode is enabled carried in the coded bit stream of the current block. Otherwise, when the current block supports the CIIP mode, the flag value of the CIIP mode is derived to be 1, and when the current block does not support the CIIP mode, the flag value of the CIIP mode is derived to be 0.
[0223] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4E As shown, if the flag value of the normal fusion mode is 1, it can be determined that the target prediction mode enabled by the current block is the normal fusion mode. If the flag value of the normal fusion mode is 0, and the flag value of the sub-block fusion mode is 1, it can be determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, and the flag value of the MMVD mode is 1, it can be determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 1, it can be determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 0, it can be determined that the target prediction mode enabled by the current block is the TPM mode.
[0224] In a possible implementation manner, corresponding to the above processing flow of the decoding end, for the encoding end, the encoding end first determines the target prediction mode, and determines the prediction mode flag information of the current block according to the target prediction mode, see Figure 4E As shown, assuming that the target prediction mode is the normal fusion mode, the prediction mode flag information includes: the flag value of the normal fusion mode is 1. For other implementation processes, refer to the above embodiment 3, except that the decoding conditions are shown in Table 6.
[0225] On the basis of the above-mentioned embodiments 3 to 7, a GEO mode can be added after the TPM mode. The GEO mode is similar to the TPM mode, except that the division shape is different. The GEO mode divides a square block into two sub-blocks of any shape (any other shape except the shape of the two triangular sub-blocks of the TPM mode, which can be a triangular sub-block, a pentagonal sub-block, a triangular sub-block, a quadrilateral sub-block, or two trapezoidal sub-blocks), and the two sub-blocks have different unidirectional motion information. The following is a description of the encoding and decoding method including the GEO mode in conjunction with specific embodiments.
[0226] Example 8: Based on Example 3, the GEO mode can be added after the TPM mode, and the implementation process is similar to that of Example 3. Figure 4F As shown, it is a schematic diagram of the coding and decoding method of the prediction mode flag. The candidate prediction modes include sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, and the order of obtaining the flag values of the candidate prediction modes is, from front to back, the flag value of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode.
[0227] When determining the prediction mode flag information of the current block, the flag value of each prediction mode is obtained in the following manner:
[0228] Get the flag value of the sub-block fusion mode.
[0229] If the flag value of the sub-block merging mode is 1, the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block merging mode.
[0230] If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode continues to be obtained.
[0231] If the flag value of the common fusion mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the sub-block fusion mode and the flag value of the common fusion mode.
[0232] If the flag value of the normal fusion mode is 0, continue to obtain the flag value of the MMVD mode.
[0233] If the flag value of the MMVD mode is 1, the flag value acquisition process ends. The prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the common fusion mode, and the flag value of the MMVD mode.
[0234] If the flag value of the MMVD mode is 0, continue to obtain the flag value of the CIIP mode.
[0235] If the flag value of the CIIP mode is 1, the flag value acquisition process ends. The prediction mode flag information may include the flag value of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode.
[0236] If the flag value of the CIIP mode is 0, continue to obtain the flag value of the GEO mode, and after obtaining the flag value of the GEO mode, end the flag value acquisition process. The prediction mode flag information may include the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode.
[0237] In this embodiment, see Table 7, which is an example of decoding conditions for flag values of each prediction mode.
[0238] Table 7
[0239]
[0240]
[0241] Regarding the decoding conditions for the flag value of the sub-block fusion mode, the decoding conditions for the flag value of the common fusion mode, the decoding conditions for the flag value of the MMVD mode, and the decoding conditions for the flag value of the CIIP mode, please refer to Example 3, which will not be repeated here. In this embodiment, the decoding conditions for the flag value of the GEO mode are additionally added, which are described below.
[0242] The decoding conditions of the flag value of the GEO mode include the support of the current block for the GEO mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the GEO mode may include: if the current block supports the GEO mode and the current block supports the TPM mode, then the flag value of the GEO mode is read from the flag indication information of whether the GEO mode is enabled carried in the coded bit stream of the current block; otherwise, when the current block supports the GEO mode, the flag value of the GEO mode is derived to be 1, and when the current block does not support the GEO mode, the flag value of the GEO mode is derived to be 0.
[0243] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4FAs shown, if the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the sub-block fusion mode is 0, and the flag value of the ordinary fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the ordinary fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, the flag value of the MMVD mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode. If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 1, then it is determined that the target prediction mode enabled for the current block is the GEO mode.
[0244] Example 9: Based on Example 4, the GEO mode can be added after the TPM mode, and the implementation process is similar to that of Example 4. Figure 4G As shown, it is a schematic diagram of the coding and decoding method of the prediction mode flag. The candidate prediction modes include sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, and the order of obtaining the flag values of the candidate prediction modes is from front to back: flag value of sub-block fusion mode, flag value of common fusion mode, flag value of MMVD mode, flag value of CIIP mode, and flag value of GEO mode.
[0245] When determining the prediction mode flag information of the current block, the flag value of each prediction mode is obtained in the following manner:
[0246] Get the flag value of the sub-block fusion mode.
[0247] If the flag value of the sub-block merging mode is 1, the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block merging mode.
[0248] If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode is obtained.
[0249] If the flag value of the normal fusion mode is 1, the flag value of the MMVD mode is obtained, and the flag value acquisition process is terminated. In this case, the prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, and the flag value of the MMVD mode.
[0250] If the flag value of the common fusion mode is 0, the flag value of the CIIP mode is obtained.
[0251] If the flag value of the CIIP mode is 1, the flag value acquisition process ends. In this case, the prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the common fusion mode, and the flag value of the CIIP mode.
[0252] If the flag value of the CIIP mode is 0, the flag value of the GEO mode is obtained, and the flag value acquisition process ends. The prediction mode flag information includes the flag value of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the CIIP mode, and the flag value of the GEO mode.
[0253] In this embodiment, see Table 8, which is an example of decoding conditions for flag values of each prediction mode.
[0254] Table 8
[0255]
[0256] On the basis of Example 4, additional decoding conditions for the flag value of the GEO mode are added, which are explained below.
[0257] The decoding conditions of the flag value of the GEO mode include the support of the current block for the GEO mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the GEO mode may include: if the current block supports the GEO mode and the current block supports the TPM mode, then the flag value of the GEO mode is read from the flag indication information of whether the GEO mode is enabled carried in the coded bit stream of the current block; otherwise, when the current block supports the GEO mode, the flag value of the GEO mode is derived to be 1, and when the current block does not support the GEO mode, the flag value of the GEO mode is derived to be 0.
[0258] Based on the above processing, the prediction mode flag information is obtained, and the target prediction mode enabled for the current block is determined according to the prediction mode flag information. Figure 4GAs shown, if the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 1, and the flag value of the MMVD mode is 0, it is determined that the target prediction mode enabled by the current block is the ordinary fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 1, and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode. If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 1, it is determined that the target prediction mode enabled for the current block is the GEO mode.
[0259] Example 10: Based on Example 5, the GEO mode can be added after the TPM mode, and the implementation process is similar to that of Example 5. Figure 4H As shown, it is a schematic diagram of the coding and decoding method of the prediction mode flag. The candidate prediction modes include sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, and the order of obtaining the flag values of the candidate prediction modes is from front to back: flag value of common fusion mode, flag value of sub-block fusion mode, flag value of MMVD mode, flag value of CIIP mode, and flag value of GEO mode.
[0260] When determining the prediction mode flag information of the current block, the flag value of each prediction mode is obtained in the following manner:
[0261] Get the flag value of the normal fusion mode. If the flag value of the normal fusion mode is 1, continue to get the flag value of the sub-block fusion mode, and end the flag value acquisition process.
[0262] If the flag value of the normal fusion mode is 0, continue to obtain the flag value of the MMVD mode.
[0263] If the flag value of the MMVD mode is 1, the process of obtaining the flag value is terminated.
[0264] If the flag value of the MMVD mode is 0, continue to obtain the flag value of the CIIP mode.
[0265] If the flag value of the CIIP mode is 1, the flag value acquisition process ends. If the flag value of the CIIP mode is 0, the flag value of the GEO mode continues to be acquired, and the flag value acquisition process ends.
[0266] For the decoding conditions of the flag value of the normal fusion mode, the decoding conditions of the flag value of the sub-block fusion mode, the decoding conditions of the flag value of the MMVD mode, and the decoding conditions of the flag value of the CIIP mode, please refer to Table 4 of Example 5. In this embodiment, the decoding conditions of the flag value of the GEO mode are additionally added. Exemplarily, the decoding conditions of the flag value of the GEO mode include the support of the current block for the GEO mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the GEO mode may include: if the current block supports the GEO mode and the current block supports the TPM mode, then the flag value of the GEO mode is read from the flag indication information of whether the GEO mode is enabled carried in the coded bit stream of the current block; otherwise, when the current block supports the GEO mode, the flag value of the GEO mode is derived to be 1, and when the current block does not support the GEO mode, the flag value of the GEO mode is derived to be 0.
[0267] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4H As shown, if the flag value of the normal fusion mode is 1 and the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the normal fusion mode is 1 and the flag value of the sub-block fusion mode is 0, it is determined that the target prediction mode enabled by the current block is the normal fusion mode. If the flag value of the normal fusion mode is 0 and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode. If the flag value of the normal fusion mode is 0, the flag value of the MMVD mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 1, it is determined that the target prediction mode enabled for the current block is the GEO mode.
[0268] Example 11: Based on Example 6, the GEO mode can be added after the TPM mode, and the implementation process is similar to that of Example 6. Fig. 4I As shown, it is a schematic diagram of the coding and decoding method of the prediction mode flag. The candidate prediction modes include sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, and the order of obtaining the flag values of the candidate prediction modes is from front to back: flag value of sub-block fusion mode, flag value of MMVD mode, flag value of common fusion mode, flag value of CIIP mode, and flag value of GEO mode.
[0269] When determining the prediction mode flag information of the current block, the flag value of each prediction mode is obtained in the following manner:
[0270] Get the flag value of the sub-block fusion mode. If the flag value of the sub-block fusion mode is 1, continue to get the flag value of the MMVD mode, and end the flag value acquisition process.
[0271] If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode continues to be obtained.
[0272] If the flag value of the normal fusion mode is 1, the process of obtaining the flag value is terminated.
[0273] If the flag value of the common fusion mode is 0, continue to obtain the flag value of the CIIP mode.
[0274] If the flag value of the CIIP mode is 1, the flag value acquisition process ends. If the flag value of the CIIP mode is 0, the flag value of the GEO mode continues to be acquired, and the flag value acquisition process ends.
[0275] For the decoding conditions of the flag value of the sub-block fusion mode, the decoding conditions of the flag value of the MMVD mode, the decoding conditions of the flag value of the normal fusion mode, and the decoding conditions of the flag value of the CIIP mode, please refer to Table 5 of Example 6. In this embodiment, the decoding conditions of the flag value of the GEO mode are additionally added. Exemplarily, the decoding conditions of the flag value of the GEO mode include the support of the current block for the GEO mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the GEO mode may include: if the current block supports the GEO mode and the current block supports the TPM mode, then the flag value of the GEO mode is read from the flag indication information of whether the GEO mode is enabled carried in the coded bit stream of the current block; otherwise, when the current block supports the GEO mode, the flag value of the GEO mode is derived to be 1, and when the current block does not support the GEO mode, the flag value of the GEO mode is derived to be 0.
[0276] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Fig. 4I As shown, if the flag value of the sub-block fusion mode is 1 and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the sub-block fusion mode is 1 and the flag value of the MMVD mode is 0, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the sub-block fusion mode is 0 and the flag value of the ordinary fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the ordinary fusion mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the sub-block fusion mode is 0, the flag value of the ordinary fusion mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode. If the flag value of the sub-block fusion mode is 0, the flag value of the normal fusion mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 1, it is determined that the target prediction mode enabled for the current block is the GEO mode.
[0277] Example 12: Based on Example 7, the GEO mode can be added after the TPM mode, and the implementation process is similar to that of Example 7. Figure 4J As shown, it is a schematic diagram of the coding and decoding method of the prediction mode flag. The candidate prediction modes include sub-block fusion mode, common fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode, and the order of obtaining the flag values of the candidate prediction modes is, from front to back, the flag value of the common fusion mode, the flag value of the sub-block fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode.
[0278] When determining the prediction mode flag information of the current block, the flag value of each prediction mode is obtained in the following manner:
[0279] Get the flag value of the normal fusion mode.
[0280] If the flag value of the normal fusion mode is 1, the process of obtaining the flag value is terminated.
[0281] If the flag value of the normal fusion mode is 0, continue to obtain the flag value of the sub-block fusion mode.
[0282] If the flag value of the sub-block fusion mode is 1, the process of obtaining the flag value is terminated.
[0283] If the flag value of the sub-block fusion mode is 0, continue to obtain the flag value of the MMVD mode.
[0284] If the flag value of the MMVD mode is 1, the process of obtaining the flag value is terminated.
[0285] If the flag value of the MMVD mode is 0, continue to obtain the flag value of the CIIP mode.
[0286] If the flag value of the CIIP mode is 1, the flag value acquisition process ends. If the flag value of the CIIP mode is 0, the flag value of the GEO mode continues to be acquired, and the flag value acquisition process ends.
[0287] For the decoding conditions of the flag value of the normal fusion mode, the decoding conditions of the flag value of the sub-block fusion mode, the decoding conditions of the flag value of the MMVD mode, and the decoding conditions of the flag value of the CIIP mode, please refer to Table 6 of Example 7. In this embodiment, the decoding conditions of the flag value of the GEO mode are additionally added. Exemplarily, the decoding conditions of the flag value of the GEO mode include the support of the current block for the GEO mode and the support of the current block for the TPM mode. The method for obtaining the flag value of the GEO mode may include: if the current block supports the GEO mode and the current block supports the TPM mode, then the flag value of the GEO mode is read from the flag indication information of whether the GEO mode is enabled carried in the coded bit stream of the current block; otherwise, when the current block supports the GEO mode, the flag value of the GEO mode is derived to be 1, and when the current block does not support the GEO mode, the flag value of the GEO mode is derived to be 0.
[0288] Based on the above processing, the prediction mode flag information of the current block can be obtained, and the target prediction mode enabled by the current block can be determined according to the prediction mode flag information. Figure 4JAs shown, if the flag value of the normal fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the normal fusion mode. If the flag value of the normal fusion mode is 0, and the flag value of the sub-block fusion mode is 1, it is determined that the target prediction mode enabled by the current block is the sub-block fusion mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, and the flag value of the MMVD mode is 1, it is determined that the target prediction mode enabled by the current block is the MMVD mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, the flag value of the MMVD mode is 0, and the flag value of the CIIP mode is 1, it is determined that the target prediction mode enabled by the current block is the CIIP mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, the flag value of the MMVD mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 0, it is determined that the target prediction mode enabled by the current block is the TPM mode. If the flag value of the normal fusion mode is 0, the flag value of the sub-block fusion mode is 0, the flag value of the MMVD mode is 0, the flag value of the CIIP mode is 0, and the flag value of the GEO mode is 1, it is determined that the target prediction mode enabled for the current block is the GEO mode.
[0289] Of course, the above-mentioned embodiments 3 to 12 are just a few examples, and there is no limitation on this. When the order of obtaining the flag values of the candidate prediction modes is different, different encoding and decoding methods of the prediction mode flags can be used. For example, the order of obtaining the flag values of the candidate prediction modes is from front to back: the flag value of the MMVD mode, the flag value of the ordinary fusion mode, the flag value of the sub-block fusion mode, and the flag value of the CIIP mode. For embodiment 3, see Figure 4A As shown, the position of the flag value of the MMVD mode and the flag value of the sub-block fusion mode can be replaced to obtain a new implementation method. Figure 4B As shown in FIG. 1 , the positions of the flag values of the MMVD mode and the flag values of the sub-block fusion mode can be replaced to obtain a new implementation method. In summary, based on the order of obtaining the flag values of the candidate prediction modes, the following can be used: Figure 4A-4J The structure determines the target prediction mode enabled for the current block.
[0290] Embodiment 13: With respect to Embodiment 1 to Embodiment 12, regarding whether the current block supports the sub-block fusion mode, it can be determined in the following ways whether the current block supports the sub-block fusion mode.
[0291] In a possible implementation, it can be determined that the current block supports the sub-block fusion mode in the following manner: if the current block is allowed to adopt the affine mode or the current block is allowed to adopt the sub-block TMVP mode according to the sequence-level switch control information, and the size information of the current block meets the first size restriction condition, it can be determined that the current block supports the sub-block fusion mode.
[0292] In another possible implementation, it can be determined that the current block supports the sub-block fusion mode in the following manner: if the current block is allowed to adopt the affine mode or the current block is allowed to adopt the sub-block TMVP mode according to the sequence-level switch control information, and the length of the motion information list allowing the sub-block fusion mode according to the sequence-level switch control information is greater than 0, and the size information of the current block satisfies the first size restriction condition, it can be determined that the current block supports the sub-block fusion mode.
[0293] Exemplarily, the first size restriction condition may be arbitrarily configured as needed. For example, when the width value of the current block is greater than or equal to 8 and the height value of the current block is greater than or equal to 8, the size information of the current block satisfies the first size restriction condition.
[0294] Of course, the above is only an example of the first size restriction condition, and there is no limitation on this. For example, when the width value of the current block is greater than or equal to 16 and the height value of the current block is greater than or equal to 16, the size information of the current block meets the first size restriction condition. For another example, when the width value of the current block is greater than or equal to 8 and less than or equal to 64 and the height value of the current block is greater than or equal to 8 and less than or equal to 64, the size information of the current block meets the first size restriction condition.
[0295] For Example 1 to Example 12, it is related to whether the current block supports the MMVD mode. In a possible implementation, it can be determined in the following manner that the current block supports the MMVD mode: if the current block is allowed to adopt the MMVD mode according to the sequence-level switch control information, it is determined that the current block supports the MMVD mode. Of course, the above method is only an example, and other factors can also be used to determine whether the current block supports the MMVD mode, and there is no limitation on this. For example, if the current block is allowed to adopt the MMVD mode according to the sequence-level switch control information, and the size information of the current block meets the size restriction condition, such as the width value of the current block is greater than or equal to 8, and the height value of the current block is greater than or equal to 8, it is determined that the current block supports the MMVD mode.
[0296] For Example 1 to Example 12, whether the current block supports the CIIP mode is involved. In a possible implementation, it can be determined that the current block supports the CIIP mode in the following manner: if the current block is allowed to adopt the CIIP mode according to the sequence-level switch control information, and the current block does not enable the skip mode, and the size information of the current block meets the second size restriction condition, then it is determined that the current block supports the CIIP mode. Of course, the above manner is only an example and is not limited to this.
[0297] Exemplarily, the second size restriction condition can be arbitrarily configured as needed, for example, when the product of the width value and the height value of the current block is greater than or equal to 64, the width value of the current block is less than 128, and the height value of the current block is less than 128, then the size information of the current block satisfies the second size restriction condition. Of course, the above is only an example of the second size restriction condition, and no limitation is imposed on this.
[0298] For example, when the width value of the current block is greater than or equal to 64 and less than 128, and the height value of the current block is greater than or equal to 64 and less than 128, the size information of the current block meets the second size restriction condition. For another example, when the width value of the current block is greater than or equal to 8 and less than 128, and the height value of the current block is greater than or equal to 8 and less than 128, the size information of the current block meets the second size restriction condition. For another example, when the width value of the current block is greater than or equal to 64, and the height value of the current block is greater than or equal to 64, the size information of the current block meets the second size restriction condition. For another example, when the width value of the current block is less than 128, and the height value of the current block is less than 128, the size information of the current block meets the second size restriction condition.
[0299] Regarding Embodiments 1 to 7, whether the current block supports the TPM mode may be determined in the following ways.
[0300] In a possible implementation, it can be determined that the current block supports the TPM mode in the following manner: if the current block is allowed to adopt the TPM mode according to the sequence-level switch control information, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block meets the third size restriction condition, then it is determined that the current block supports the TPM mode.
[0301] In another possible implementation, it can be determined that the current block supports the TPM mode in the following manner: if the current block is allowed to adopt the TPM mode according to the sequence-level switch control information, and the length of the motion information list that allows the TPM mode according to the sequence-level switch control information is greater than or equal to 2, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block satisfies the third size restriction condition, it can be determined that the current block supports the TPM mode.
[0302] Regarding Embodiment 1, Embodiment 2, Embodiment 8 to Embodiment 12, whether the current block supports the TPM mode may be determined in the following ways.
[0303] In a possible implementation, it can be determined that the current block supports the TPM mode in the following manner: if the current block is allowed to adopt the TPM mode according to the sequence-level switch control information or the sequence-level switch control information allows the current block to adopt the GEO mode, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block meets the third size restriction condition, then it is determined that the current block supports the TPM mode.
[0304] In another possible implementation, it can be determined that the current block supports the TPM mode in the following manner: if the current block is allowed to adopt the TPM mode according to the sequence-level switch control information and the length of the motion information list that allows the TPM mode according to the sequence-level switch control information is greater than or equal to 2; or, the current block is allowed to adopt the GEO mode according to the sequence-level switch control information and the length of the motion information list that allows the GEO mode according to the sequence-level switch control information is greater than or equal to 2. On the basis of the above conditions being met, the following conditions need to be met: the frame type of the image frame where the current block is located is a B frame, and the size information of the current block meets the third size restriction condition. After the above conditions are met, it can be determined that the current block supports the TPM mode.
[0305] Exemplarily, the third size restriction condition may be arbitrarily configured as needed. For example, when the product of the width value of the current block and the height value of the current block is greater than or equal to 64, the size information of the current block satisfies the third size restriction condition.
[0306] Of course, the above is only an example of the third size restriction condition and is not limited thereto. For example, when the width value of the current block is greater than or equal to 8 and the height value of the current block is greater than or equal to 8, the size information of the current block can meet the third size restriction condition. For another example, when the width value of the current block is greater than or equal to 8 and less than 128 and the height value of the current block is greater than or equal to 8 and less than 128, the size information of the current block can meet the third size restriction condition.
[0307] For Example 8 to Example 12, it involves whether the current block supports the GEO mode.
[0308] In a possible implementation, it can be determined that the current block supports the GEO mode in the following manner: if the current block is allowed to adopt the GEO mode according to the sequence-level switch control information, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block meets the fourth size restriction condition, then it is determined that the current block supports the GEO mode.
[0309] Exemplarily, the fourth size restriction condition may be arbitrarily configured as needed. For example, when the product of the width value of the current block and the height value of the current block is greater than or equal to 64, the size information of the current block satisfies the fourth size restriction condition.
[0310] Of course, the above is only an example of the fourth size restriction condition, and there is no limitation on this. For example, when the width value of the current block is greater than or equal to 8 and the height value of the current block is greater than or equal to 8, the size information of the current block can meet the fourth size restriction condition. For another example, when the width value of the current block is greater than or equal to 8 and less than 128 and the height value of the current block is greater than or equal to 8 and less than 128, the size information of the current block can meet the fourth size restriction condition.
[0311] Embodiment 14:
[0312] Based on the same application concept as the above method, the embodiment of the present application also proposes a decoding device, which is applied to a decoding end, such as Figure 5A As shown, it is a structural diagram of the device, and the device may include:
[0313] A first determination module 511 is used to determine the prediction mode flag information of the current block, the prediction mode flag information includes a flag value of at least one candidate prediction mode among N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled; wherein, for each flag value of the candidate prediction mode, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag value is read from the flag indication information of whether to enable the candidate prediction mode carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag value is the derived flag value of the candidate prediction mode;
[0314] A second determination module 512 is configured to determine a target prediction mode enabled by the current block according to the prediction mode flag information, wherein the target prediction mode is one of the N candidate prediction modes;
[0315] The decoding module 513 is configured to decode the current block according to the target prediction mode.
[0316] The N candidate prediction modes include at least one of the following: sub-block fusion mode, normal fusion mode, MMVD mode, CIIP mode, TPM mode, GEO mode.
[0317] The first determination module 511 is specifically used to: determine the prediction mode flag information according to the acquisition order of the flag values of the N candidate prediction modes; if the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, and a CIIP mode, then the acquisition order of the flag values of the N candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode; or, if the N candidate prediction modes include a sub-block fusion mode, a normal fusion mode, an MMVD mode, a CIIP mode, and a GEO mode, then the acquisition order of the flag values of the N candidate prediction modes is from front to back: the flag value of the sub-block fusion mode, the flag value of the normal fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode.
[0318] The first determination module 511 is specifically used to: based on the acquisition order of the flag values of the N candidate prediction modes, after obtaining the flag value of the current candidate prediction mode, determine whether to obtain the flag value of the candidate prediction mode following the current candidate prediction mode according to the flag value of the current candidate prediction mode.
[0319] When the flag values of the N candidate prediction modes are acquired in the order of the flag value of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, and the flag value of the CIIP mode, the first determining module 511 acquires the flag value of the candidate prediction mode in the following manner:
[0320] Obtain the flag value of the sub-block fusion mode; if the flag value of the sub-block fusion mode is the first value, then terminate the flag value acquisition process; if the flag value of the sub-block fusion mode is the second value, then obtain the flag value of the common fusion mode; if the flag value of the common fusion mode is the first value, then terminate the flag value acquisition process; if the flag value of the common fusion mode is the second value, then obtain the flag value of the MMVD mode; if the flag value of the MMVD mode is the first value, then terminate the flag value acquisition process; if the flag value of the MMVD mode is the second value, then obtain the flag value of the CIIP mode, and terminate the flag value acquisition process; or,
[0321] Obtain the flag value of the sub-block fusion mode; if the flag value of the sub-block fusion mode is the first value, then terminate the flag value acquisition process; if the flag value of the sub-block fusion mode is the second value, then obtain the flag value of the normal fusion mode; if the flag value of the normal fusion mode is the first value, then obtain the flag value of the MMVD mode, and terminate the flag value acquisition process; if the flag value of the normal fusion mode is the second value, then obtain the flag value of the CIIP mode, and terminate the flag value acquisition process.
[0322] When the flag values of the N candidate prediction modes are obtained in the order of the flag value of the sub-block fusion mode, the flag value of the common fusion mode, the flag value of the MMVD mode, the flag value of the CIIP mode, and the flag value of the GEO mode, the first determination module 511 obtains the flag value of the candidate prediction mode in the following manner:
[0323] Obtain the flag value of the sub-block fusion mode; if the flag value of the sub-block fusion mode is the first value, then terminate the flag value acquisition process; if the flag value of the sub-block fusion mode is the second value, then obtain the flag value of the common fusion mode; if the flag value of the common fusion mode is the first value, then terminate the flag value acquisition process; if the flag value of the common fusion mode is the second value, then obtain the flag value of the MMVD mode; if the flag value of the MMVD mode is the first value, then terminate the flag value acquisition process; if the flag value of the MMVD mode is the second value, then obtain the flag value of the CIIP mode; if the flag value of the CIIP mode is the first value, then terminate the flag value acquisition process; if the flag value of the CIIP mode is the second value, then obtain G The flag value of the EO mode is obtained, and the process of obtaining the flag value is ended; or, the flag value of the sub-block fusion mode is obtained; if the flag value of the sub-block fusion mode is the first value, the process of obtaining the flag value is ended; if the flag value of the sub-block fusion mode is the second value, the flag value of the ordinary fusion mode is obtained; if the flag value of the ordinary fusion mode is the first value, the flag value of the MMVD mode is obtained, and the process of obtaining the flag value is ended; if the flag value of the ordinary fusion mode is the second value, the flag value of the CIIP mode is obtained; if the flag value of the CIIP mode is the first value, the process of obtaining the flag value is ended; if the flag value of the CIIP mode is the second value, the flag value of the GEO mode is obtained, and the process of obtaining the flag value is ended.
[0324] The decoding conditions for the flag value of the sub-block fusion mode include the support of the current block for the sub-block fusion mode, and the first determination module 511 is also used to: if the current block supports the sub-block fusion mode, read the flag value of the sub-block fusion mode from the flag indication information of whether the sub-block fusion mode is enabled carried in the encoded bit stream of the current block; otherwise, derive the flag value of the sub-block fusion mode as the second value.
[0325] The decoding conditions of the flag value of the common fusion mode include the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The first determination module 511 is also used for: if the current block supports the MMVD mode, or the current block supports the CIIP mode, or the current block supports the TPM mode, then reading the flag value of the common fusion mode from the flag indication information of whether the common fusion mode is enabled carried in the coded bit stream of the current block; otherwise, deriving the flag value of the common fusion mode as the first value;
[0326] Alternatively, the decoding conditions for the flag value of the normal fusion mode include the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The first determination module 511 is also used to: if the current block supports the CIIP mode, or the current block supports the TPM mode, then read the flag value of the normal fusion mode from the flag indication information of whether the normal fusion mode is enabled carried in the encoded bit stream of the current block; otherwise, derive the flag value of the normal fusion mode as the first value.
[0327] The decoding conditions of the flag value of the MMVD mode include the support of the current block for the MMVD mode, the support of the current block for the CIIP mode, and the support of the current block for the TPM mode. The first determination module 511 is also used for: if the current block supports the MMVD mode and the current block supports the CIIP mode, or the current block supports the MMVD mode and the current block supports the TPM mode, then reading the flag value of the MMVD mode from the flag indication information of whether the MMVD mode is enabled carried in the coded bit stream of the current block; otherwise, when the current block supports the MMVD mode, deriving the flag value of the MMVD mode as the first value, and when the current block does not support the MMVD mode, deriving the flag value of the MMVD mode as the second value;
[0328] Alternatively, the decoding conditions for the flag value of the MMVD mode include the support of the current block for the MMVD mode, and the first determination module 511 is also used to: if the current block supports the MMVD mode, read the flag value of the MMVD mode from the flag indication information of whether the MMVD mode is enabled carried in the encoded bit stream of the current block; otherwise, derive the flag value of the MMVD mode as the second value.
[0329] The decoding conditions for the flag value of the CIIP mode include the support of the current block for the CIIP mode and the support of the current block for the TPM mode. The first determination module 511 is also used to: if the current block supports the CIIP mode and the current block supports the TPM mode, read the flag value of the CIIP mode from the flag indication information of whether the CIIP mode is enabled carried in the encoded bit stream of the current block; otherwise, when the current block supports the CIIP mode, derive the flag value of the CIIP mode as the first value, and when the current block does not support the CIIP mode, derive the flag value of the CIIP mode as the second value.
[0330] The decoding conditions for the flag value of the GEO mode include the support of the current block for the GEO mode and the support of the current block for the TPM mode. The first determination module 511 is also used to: if the current block supports the GEO mode and the current block supports the TPM mode, read the flag value of the GEO mode from the flag indication information of whether the GEO mode is enabled carried in the encoded bit stream of the current block; otherwise, when the current block supports the GEO mode, derive the flag value of the GEO mode as the first value, and when the current block does not support the GEO mode, derive the flag value of the GEO mode as the second value.
[0331] The second determination module 512 is specifically configured to: if the flag value of the sub-block fusion mode is a first value, determine that the target prediction mode enabled by the current block is the sub-block fusion mode.
[0332] The second determination module 512 is specifically used for: if the flag value of the sub-block fusion mode is the second value, and the flag value of the normal fusion mode is the first value, then determining that the target prediction mode enabled by the current block is the normal fusion mode; or, if the flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the first value, and the flag value of the MMVD mode is the second value, then determining that the target prediction mode enabled by the current block is the normal fusion mode.
[0333] The second determination module 512 is specifically used for: if the flag value of the sub-block fusion mode is the second value, the flag value of the common fusion mode is the second value, and the flag value of the MMVD mode is the first value, then determining that the target prediction mode enabled for the current block is the MMVD mode; or, if the flag value of the sub-block fusion mode is the second value, the flag value of the common fusion mode is the first value, and the flag value of the MMVD mode is the first value, then determining that the target prediction mode enabled for the current block is the MMVD mode.
[0334] The second determination module 512 is specifically used for: if the flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the second value, the flag value of the MMVD mode is the second value, and the flag value of the CIIP mode is the first value, then determining that the target prediction mode enabled for the current block is the CIIP mode; or, if the flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the second value, and the flag value of the CIIP mode is the first value, then determining that the target prediction mode enabled for the current block is the CIIP mode.
[0335] The second determination module 512 is specifically used for: if the flag value of the sub-block fusion mode is the second value, the flag value of the common fusion mode is the second value, the flag value of the MMVD mode is the second value, and the flag value of the CIIP mode is the second value, then determining that the target prediction mode enabled by the current block is the TPM mode; or, if the flag value of the sub-block fusion mode is the second value, the flag value of the common fusion mode is the second value, and the flag value of the CIIP mode is the second value, then determining that the target prediction mode enabled by the current block is the TPM mode; or, if the sub-block fusion mode is The flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the second value, the flag value of the MMVD mode is the second value, the flag value of the CIIP mode is the second value, and the flag value of the GEO mode is the second value, then it is determined that the target prediction mode enabled for the current block is the TPM mode; or, if the flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the second value, the flag value of the CIIP mode is the second value, and the flag value of the GEO mode is the second value, then it is determined that the target prediction mode enabled for the current block is the TPM mode.
[0336] The second determination module 512 is specifically used for: if the flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the second value, the flag value of the MMVD mode is the second value, the flag value of the CIIP mode is the second value, and the flag value of the GEO mode is the first value, then determine that the target prediction mode enabled for the current block is the GEO mode; or, if the flag value of the sub-block fusion mode is the second value, the flag value of the normal fusion mode is the second value, the flag value of the CIIP mode is the second value, and the flag value of the GEO mode is the first value, then determine that the target prediction mode enabled for the current block is the GEO mode.
[0337] The first determination module 511 is also used to determine that the current block supports the sub-block fusion mode in the following manner: if the current block is allowed to adopt the affine mode or the current block is allowed to adopt the sub-block TMVP mode according to the sequence-level switch control information, and the size information of the current block meets the first size restriction condition, then determine that the current block supports the sub-block fusion mode.
[0338] The first determination module 511 is further configured to determine that the current block supports the MMVD mode in the following manner: if the current block is allowed to adopt the MMVD mode according to the sequence-level switch control information, then determine that the current block supports the MMVD mode.
[0339] The first determination module 511 is also used to determine whether the current block supports the CIIP mode in the following manner: if the current block is allowed to adopt the CIIP mode according to the sequence-level switch control information, and the skip mode is not enabled for the current block, and the size information of the current block meets the second size restriction condition, then it is determined that the current block supports the CIIP mode.
[0340] The first determination module 511 is further used to determine whether the current block supports the TPM mode in the following manner: if the current block is allowed to adopt the TPM mode according to the sequence-level switch control information, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block satisfies the third size restriction condition, then it is determined that the current block supports the TPM mode; or, if the current block is allowed to adopt the TPM mode according to the sequence-level switch control information or the sequence-level switch control information allows the current block to adopt the GEO mode, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block satisfies the third size restriction condition, then it is determined that the current block supports the TPM mode.
[0341] The first determination module 511 is also used to determine that the current block supports the GEO mode in the following manner: if the current block is allowed to adopt the GEO mode according to the sequence-level switch control information, and the frame type of the image frame where the current block is located is a B frame, and the size information of the current block meets the fourth size restriction condition, then it is determined that the current block supports the GEO mode.
[0342] Based on the same application concept as the above method, the embodiment of the present application also proposes a coding device, which is applied to the coding end, such as Figure 5B As shown in FIG. 1 , it is a structural diagram of the encoding device, and the encoding device may include:
[0343] A first determination module 521, configured to determine a target prediction mode enabled for a current block, wherein the target prediction mode is one of N candidate prediction modes for the current block;
[0344] A second determination module 522 is used to determine the prediction mode flag information of the current block according to the target prediction mode; the prediction mode flag information includes a flag value of at least one candidate prediction mode among the N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled;
[0345] The encoding module 523 is used to encode the current block according to the prediction mode flag information; wherein, for the flag value of each candidate prediction mode included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is carried in the encoded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, then the flag indication information of whether the candidate prediction mode is enabled is not carried in the encoded bit stream of the current block.
[0346] The decoding end device provided in the embodiment of the present application, from the hardware level, its hardware architecture diagram can be seen in Fig. 6AThe system comprises: a processor 611 and a machine-readable storage medium 612, wherein the machine-readable storage medium 612 stores machine-executable instructions that can be executed by the processor 611; the processor 611 is used to execute the machine-executable instructions to implement the method disclosed in the above example of the present application. For example, the processor 611 is used to execute machine executable instructions to implement the following steps: determine the prediction mode flag information of the current block, the prediction mode flag information includes the flag value of at least one candidate prediction mode among N candidate prediction modes, when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled; wherein, for the flag value of each candidate prediction mode, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag value is read from the flag indication information of whether the candidate prediction mode is enabled carried in the encoded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag value is the derived flag value of the candidate prediction mode; determine the target prediction mode enabled for the current block according to the prediction mode flag information, the target prediction mode is one of the N candidate prediction modes; and decode the current block according to the target prediction mode.
[0347] The encoding end device provided in the embodiment of the present application, from the hardware level, its hardware architecture diagram can be seen in Figure 6BThe system comprises: a processor 621 and a machine-readable storage medium 622, wherein the machine-readable storage medium 622 stores machine-executable instructions that can be executed by the processor 621; the processor 621 is used to execute the machine-executable instructions to implement the method disclosed in the above example of the present application. For example, the processor 621 is used to execute machine executable instructions to implement the following steps: determine a target prediction mode enabled for the current block, the target prediction mode being one of N candidate prediction modes for the current block; determine prediction mode flag information of the current block according to the target prediction mode; the prediction mode flag information includes a flag value of at least one candidate prediction mode among the N candidate prediction modes, wherein when the flag value is a first value, it is used to indicate that the candidate prediction mode is enabled, and when the flag value is a second value, it is used to indicate that the candidate prediction mode is not enabled; encode the current block according to the prediction mode flag information; wherein, for each flag value of the candidate prediction mode included in the prediction mode flag information, if the current block meets the decoding condition of the flag value of the candidate prediction mode, the flag indication information of whether the candidate prediction mode is enabled is carried in the encoded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the candidate prediction mode, the flag indication information of whether the candidate prediction mode is enabled is not carried in the encoded bit stream of the current block.
[0348] Based on the same application concept as the above method, the embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by the processor, the decoding method or encoding method disclosed in the above example of the present application can be implemented. Among them, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device, which can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0349] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a tablet computer, a wearable device or a combination of any of these devices.
[0350] For the convenience of description, the above device is described by being divided into various units according to their functions and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in the same one or more software and / or hardware. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0351] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0352] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. The above description is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A decoding method, characterized in that: The method comprises: Obtaining a flag value of a sub-block fusion mode; if the flag value of the sub-block fusion mode is the second value, obtaining a flag value of a common fusion mode; If the flag value of the common fusion mode is the first value, the flag value of the fusion mode with motion vector difference is obtained; if the flag value of the fusion mode with motion vector difference is the second value, it is determined that the target prediction mode enabled by the current block is the common fusion mode; If the flag value of the common fusion mode is the second value, the flag value of the inter-frame and intra-frame joint prediction mode is obtained; if the flag value of the inter-frame and intra-frame joint prediction mode is the second value, it is determined that the target prediction mode enabled by the current block is the geometric partitioning mode; The acquiring of the flag value of the sub-block fusion mode comprises: if the current block meets the decoding condition of the flag value of the sub-block fusion mode, the flag value is read from the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the sub-block fusion mode, the flag value is the derived flag value of the sub-block fusion mode; Among them, if the current block meets the decoding conditions of the flag value of the sub-block fusion mode, the flag value of the sub-block fusion mode obtained by decoding the flag indication information of the sub-block fusion mode is the first value or the second value; if the current block does not meet the decoding conditions of the flag value of the sub-block fusion mode, the derived value of the flag value of the sub-block fusion mode is the second value.
2. The method according to claim 1, characterized in that The current block meets the decoding conditions for the flag value of the sub-block fusion mode, which at least include: the current block supports the sub-block fusion mode; the width of the current block is greater than or equal to 8, and the height of the current block is greater than or equal to 8.
3. The method according to claim 1, characterized in that The obtaining of the flag value of the common fusion mode includes: if the current block meets the decoding condition of the flag value of the common fusion mode, the flag value is read from the flag indication information of whether the common fusion mode is enabled carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the common fusion mode, the flag value is the derived flag value of the common fusion mode; Among them, if the current block meets the decoding conditions of the flag value of the normal fusion mode, the flag value of the normal fusion mode obtained by decoding the flag indication information of the normal fusion mode is the first value or the second value; if the current block does not meet the decoding conditions of the flag value of the normal fusion mode, then according to the decoded flag value of the fusion mode is the first value and the flag value of the sub-block fusion mode is the second value, the derived value of the flag value of the normal fusion mode is the first value.
4. The method according to claim 3, characterized in that The current block meets the decoding conditions for the flag value of the normal fusion mode, including at least: the width of the current block is greater than or equal to 8, the height of the current block is greater than or equal to 8, and the frame type of the image frame where the current block is located is a B frame, and the sequence-level switch control information allows the current block to adopt a geometric partitioning mode.
5. The method according to claim 3, characterized in that: The current block meets the decoding conditions for the flag value of the normal fusion mode, including at least: the sequence-level switch control information allows the current block to adopt the inter-frame and intra-frame joint prediction mode, and the area of the current block is greater than or equal to 64, the width of the current block is less than 128, the height of the current block is less than 128, and the skip mode is not enabled for the current block.
6. The method according to claim 1, characterized in that The obtaining of the flag value of the fusion mode with motion vector difference comprises: if the current block meets the decoding condition of the flag value of the fusion mode with motion vector difference, the flag value is read from the flag indication information of whether to enable the fusion mode with motion vector difference carried in the coded bit stream of the current block; if the current block does not meet the decoding condition of the flag value of the fusion mode with motion vector difference, the flag value is the derived flag value of the fusion mode with motion vector difference; Among them, if the current block meets the decoding conditions of the flag value of the fusion mode with motion vector difference, the flag value of the fusion mode with motion vector difference obtained by decoding the flag indication information of the fusion mode with motion vector difference is the first value or the second value; if the current block does not meet the decoding conditions of the flag value of the fusion mode with motion vector difference, the derived value of the flag value of the fusion mode with motion vector difference is the second value.
7. The method according to claim 6, characterized in that The current block meets the decoding conditions of the flag value of the fusion mode with motion vector difference, including: the flag value of the common fusion mode is the first value, and the sequence-level switch control information allows the current block to enable the fusion mode with motion vector difference.
8. A coding method, characterized in that: The method comprises: Determine the target prediction mode enabled for the current block; If the target prediction mode is the normal fusion mode, the flag value of the sub-block fusion mode is determined to be the second value, the flag value of the normal fusion mode is the first value, and the flag value of the fusion mode with motion vector difference is the second value; If the target prediction mode is the geometric partitioning mode, determining that the flag value of the sub-block fusion mode is the second value, the flag value of the common fusion mode is the second value, and the flag value of the inter-frame and intra-frame joint prediction mode is the second value; If the current block meets the coding condition of the flag value of the sub-block fusion mode, the flag value is encoded as the second value in the flag indication information of whether the sub-block fusion mode is enabled carried in the coded bit stream of the current block; If the current block does not meet the coding condition of the flag value of the sub-block fusion mode, the flag value is not encoded in the flag indication information of whether to enable the sub-block fusion mode carried in the coded bit stream of the current block.
9. A decoding end device, characterized in that: include: A processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; wherein the processor is used to execute the machine-executable instructions to implement the method steps described in any one of claims 1-7.
10. A coding end device, characterized in that: include: A processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; wherein the processor is configured to execute the machine-executable instructions to implement the method steps described in claim 8.
