Prediction mode decoding, encoding method and apparatus

By determining whether the specific information of the current block meets the decoding or encoding-free conditions in video encoding, the value of the mode mark bit is directly determined, and the problem of low encoding and decoding efficiency caused by the decoding prediction mode control switch mark bit in the prior art is solved, and a more efficient encoding and decoding process is realized.

CN114598878BActive Publication Date: 2025-07-22HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011410497.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-04
Publication Date
2025-07-22
Estimated Expiration
2040-12-04

AI Technical Summary

Technical Problem

In the prior art, the prediction mode needs to be determined by decoding the control switch mark bits of the prediction mode during the video encoding process, resulting in low encoding and decoding efficiency.

Method used

During the decoding and encoding process, by determining whether the specific information of the current block meets the decoding or encoding-free conditions, if it is satisfied, the value of the mode mark bit is directly determined, without decoding or encoding the binary information of the mode mark bit. If it is not satisfied, decoding or encoding is performed.

Benefits of technology

Improves encoding and decoding performance, saves encoding and decoding bits, and improves encoding and decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114598878B_ABST
    Figure CN114598878B_ABST
Patent Text Reader

Abstract

The present application provides a prediction mode decoding, encoding method and apparatus. The prediction mode decoding method includes: for a current block, before decoding the binary coding information of the mode flag to be decoded, determining whether the current block satisfies the decoding-free condition of the mode flag to be decoded according to the specific information of the current block; if the current block satisfies the decoding-free condition of the mode flag to be decoded, determining, according to the specific information, that the binary value of the mode flag to be decoded is a first value or a second value; if the current block does not satisfy the decoding-free condition of the mode flag to be decoded, reading the binary coding information of the mode flag to be decoded, decoding the coding information, and determining that the binary value of the mode flag to be decoded is a first value or a second value. This method can improve the encoding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to video image coding and decoding technologies, and particularly to a prediction mode decoding, encoding method and device. Background Art

[0002] A prediction mode refers to a mode for decoding or encoding an image block in a video frame. Since there are multiple prediction modes, a control switch flag bit is configured for each prediction mode to indicate whether the corresponding prediction mode is enabled. The encoding end encodes the control switch flag bit to indicate which prediction mode is enabled for the image block. The decoding end can decode the encoding of the control switch flag bit to determine the prediction mode adopted by the image block.

[0003] In the related art, when encoding the current block, for any prediction mode, the encoding end determines whether the prediction mode is enabled. If it is enabled, the value of the control switch flag bit for encoding prediction mode A is set to 1; if it is not enabled, the value of the control switch flag bit for encoding prediction mode A is set to 0. After encoding the control switch flag bits of each prediction mode in this way, when decoding the current block, the decoding end decodes the control switch flag bit of this prediction mode. If the decoded value of the control switch flag bit is 1, it is determined that the current block enables this prediction mode.

[0004] In this way, the decoding end needs to decode the control switch flag bit to determine whether the current block enables this prediction mode, resulting in low efficiency of encoding and decoding the prediction mode. Summary of the Invention

[0005] In view of this, the present application provides a prediction mode decoding, encoding method and device.

[0006] Specifically, the present application is implemented by the following technical solutions:

[0007] According to a first aspect of an embodiment of the present application, a prediction mode decoding method is provided, including:

[0008] For the current block, before decoding the binary encoding information of the mode flag bit to be decoded, determine whether the current block meets the decoding-free condition of the mode flag bit to be decoded according to the specific information of the current block;

[0009] If the current block meets the decoding-free condition of the mode flag bit to be decoded, determine that the binary value of the mode flag bit to be decoded is a first value or a second value according to the specific information;

[0010] If the current block does not meet the decoding exemption condition of the to-be-decoded mode flag bit, read the binary-coded information of the to-be-decoded mode flag bit, decode the coded information, and determine that the binary value of the to-be-decoded mode flag bit is the first value or the second value;

[0011] Wherein, the specific information includes the value of at least one obtained mode flag bit and / or the decoding information on whether at least one prediction mode is available.

[0012] According to the second aspect of the embodiments of the present application, a prediction mode encoding method is provided, including:

[0013] For a current block, before writing the binary-coded information of the to-be-encoded mode flag bit into the code stream, determine whether the current block meets the encoding exemption condition of the to-be-encoded mode flag bit;

[0014] If the current block meets the encoding exemption condition of the to-be-encoded mode flag bit, skip the step of writing the binary-coded information of the to-be-encoded mode flag bit into the code stream;

[0015] If the current block does not meet the encoding exemption condition of the to-be-encoded mode flag bit, write the binary-coded information of the to-be-encoded mode flag bit into the code stream.

[0016] According to the third aspect of the embodiments of the present application, a decoding device is provided, including:

[0017] A determination unit, configured to, for a current block, before decoding the binary-coded information of the to-be-decoded mode flag bit, determine whether the current block meets the decoding exemption condition of the to-be-decoded mode flag bit according to the specific information of the current block;

[0018] A decoding unit, configured to, if the current block meets the decoding exemption condition of the to-be-decoded mode flag bit, determine that the binary value of the to-be-decoded mode flag bit is the first value or the second value according to the specific information;

[0019] The decoding unit is further configured to, if the current block does not meet the decoding exemption condition of the to-be-decoded mode flag bit, read the binary-coded information of the to-be-decoded mode flag bit, decode the coded information, and determine that the binary value of the to-be-decoded mode flag bit is the first value or the second value;

[0020] Wherein, the specific information includes the value of at least one obtained mode flag bit and / or the decoding information on whether at least one prediction mode is available.

[0021] According to the fourth aspect of the embodiments of the present application, an encoding device is provided, including:

[0022] A coding unit is configured to determine, for a current block, whether the current block meets the coding - free condition of the binary - coded information of the to - be - coded mode flag bit before writing the binary - coded information of the to - be - coded mode flag bit into the code stream.

[0023] The coding unit is further configured to, if the current block meets the coding - free condition of the to - be - coded mode flag bit, skip the step of writing the binary - coded information of the to - be - coded mode flag bit into the code stream; if the current block does not meet the coding - free condition of the to - be - coded mode flag bit, write the binary - coded information of the to - be - coded mode flag bit into the code stream.

[0024] According to a fifth aspect of the embodiments of the present application, an electronic device is provided, including a processor and a machine - readable storage medium. The machine - readable storage medium stores machine - executable instructions that can be executed by the processor, and the processor is configured to execute the machine - executable instructions to implement the prediction - mode decoding method of the first aspect or the prediction - mode encoding method of the second aspect.

[0025] The prediction - mode decoding method of the embodiments of the present application, before decoding the binary - coded information of the to - be - decoded mode flag bit, determines whether the current situation meets the decoding - free condition of the to - be - decoded mode flag bit based on specific information of the current block, and when the current block meets the decoding - free condition of the to - be - decoded mode flag bit, instead of decoding the binary - coded information of the to - be - decoded mode flag bit, determines the binary value of the to - be - decoded mode flag bit according to this specific information. It realizes determining the binary value of the to - be - decoded mode flag bit without decoding the binary - coded information of the to - be - decoded mode flag bit. Thus, coding bits can be saved and the coding - decoding performance can be improved. Description of the Drawings

[0026] Figure 1A is a schematic diagram showing the weight derivation of an AWP mode shown in an exemplary embodiment of the present application;

[0027] Figure 1B is a schematic diagram of an ETMVP mode shown in an exemplary embodiment of the present application;

[0028] Figure 1C is a schematic diagram showing the relationship between an original matching block and spatially adjacent blocks shown in an exemplary embodiment of the present application;

[0029] Figures 2A - 2B is a schematic diagram of block partitioning shown in an exemplary embodiment of the present application;

[0030] Figure 3 is a schematic flowchart of a prediction - mode decoding method shown in an exemplary embodiment of the present application;

[0031] Figure 4It is a schematic flow chart showing a prediction mode encoding method according to an exemplary embodiment of the present application;

[0032] Figures 5A - 5J It is a schematic diagram of a mode flag bit binary tree shown in an embodiment of the present application;

[0033] Figure 6 It is a schematic hardware structure diagram of an electronic device shown in an exemplary embodiment of the present application;

[0034] Figure 7 It is a schematic structure diagram of a decoding device shown in an exemplary embodiment of the present application;

[0035] Figure 8 It is a schematic structure diagram of an encoding device shown in an exemplary embodiment of the present application. Detailed Description of the Invention

[0036] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0037] The terms used in the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "the" and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0038] To enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, first, a brief description will be given to the block partitioning technology in the existing video coding standard, the existing intra-frame sub-block partitioning scheme, and some technical terms related to the embodiments of the present application.

[0039] To enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, first, a brief description will be given to some technical terms related to the embodiments of the present application and the main processes of video encoding and decoding.

[0040] I. Technical Terms

[0041] 1. Flag Coding: In video coding, there are many prediction modes, such as skip mode, direct mode, etc. For a certain block, it may adopt one of these prediction modes. To indicate which prediction mode is adopted, each block needs to be marked by encoding the corresponding flag bit. That is, at the encoding end, through the encoding end decision, the value of the flag bit is determined, and then encoded and transmitted to the decoding end. The decoding end determines whether the current block adopts the corresponding prediction mode by parsing the flag bit.

[0042] 2. direct mode and skip mode: In direct mode and skip mode, the motion information of the surrounding (temporally or spatially adjacent or similar blocks) is directly reused to obtain the motion information of the current block. Skip mode is a special direct mode. In skip mode, the residual does not need to be encoded.

[0043] Direct mode and skip mode determine whether the motion information of the current block is obtained through the motion information of adjacent blocks on the reference frame (corresponding to SBTMVP mode or TMVP mode), or through angular extrapolation of the motion vectors of surrounding blocks (corresponding to MVAP mode), or through historical motion information (corresponding to HMVP mode), or some default motion information, through the index (which can be called the mode index) value.

[0044] 3. InterPF mode: In this mode, for the inter-frame prediction block encoded in direct mode (neither skip mode nor ordinary Inter mode), the final prediction value is obtained by weighted averaging the pixel values of the inter-frame prediction pixel, its left, its right, its upper, and its lower.

[0045] 4. UMVE (Ultimate Motion Vector Expression) mode: This mode is to offset based on the already generated motion candidates to obtain better motion candidates. Taking a motion candidate as the starting point, searching in four directions: up, down, left, and right, with offsets of 1 / 4, 1 / 2, 1, 2, and 4 pixels respectively, there are 2 starting points (2base), 4 offset directions (4direction), and 5 kinds of offsets (5offset), generating a total of 40 motion candidates.

[0046] Exemplarily, the UMVE mode can include the conventional UMVE mode and the mode of UMVE combined with InterPF (that is, the inter-frame prediction value in the InterPF mode is obtained through the UMVE mode).

[0047] 5. AWP (Angular Weighted Prediction) mode: This mode is designed to improve the mode of boundary blocks with two different moving objects. In this mode, the predicted values P0 and P1 of two different motion information are first obtained, and then pixel-level weights are obtained based on a method similar to intra-frame angular prediction to achieve accurate boundary expression.

[0048] Exemplarily, an example of a weight is as Figure 1A shown.

[0049] 6. ETMVP (Enhanced Temporal Motion Vector Prediction) mode: In this mode, a matching block corresponding to the current coding unit is found in the first frame of the List1 reference frame list, and then it is offset up, down, left, and right based on this matching block to obtain a new matching block. Its schematic diagram can be as Figure 1B shown.

[0050] 7. Affine mode: In this mode, based on a 4-parameter or 6-parameter affine motion model, the motion information of each sub-block of the current block is derived. Based on the motion information of each sub-block, the predicted value of the current block is obtained through motion compensation.

[0051] Exemplarily, the Affine mode can include a conventional Affine mode and an Affine_UMVE mode that combines UVME (i.e., the surrounding motion information reused by the affine mode can be adjusted by a method similar to the UMVE mode).

[0052] 8. Frame type: If the current frame cannot be encoded with reference to the information of other frames, the current frame is an I-frame; if the blocks of the current frame are only allowed to be encoded with reference to the information of a certain 1 frame (but not more than 1 frame), the current frame is a P-frame; if the blocks of the current frame are allowed to be encoded with reference to the information of a certain 1 frame or a certain 2 frames simultaneously, the current frame is a B-frame.

[0053] 9. Sequence header information (abbreviated as sh): In this sequence header information, there are flag bits that determine whether certain tool switches (methods) are allowed in the entire sequence. If the flag bit is 1, then in this sequence, this tool (method) is allowed to be enabled during the encoding process of this sequence; otherwise, this tool (method) cannot be enabled during the encoding process of this sequence.

[0054] 10. Picture Header (PH): In this picture header, there is a flag bit to determine whether certain tool switches (methods) are allowed in the current image. If the flag bit is 1, then in this image, this tool (method) is allowed to be enabled during the encoding process of this image; otherwise, this tool (method) cannot be enabled during the encoding process of this image.

[0055] 11. Rate-Distortion Optimized (RDO): The indicators for evaluating encoding efficiency include: bit rate and Peak Signal to Noise Ratio (PSNR). The smaller the bit rate, the larger the compression ratio; the larger the PSNR, the better the quality of the reconstructed image. When making mode selection, the discrimination formula is essentially a comprehensive evaluation of the two.

[0056] The cost corresponding to the mode: J(mode) = D + λ * R. Where D represents Distortion, usually measured using the SSE (Sum of Squared Errors) indicator, and SSE refers to the sum of squared differences between the reconstructed block and the source image block; λ is the Lagrange multiplier; R is the actual number of bits required for encoding the image block in this mode, including the total number of bits required for encoding mode information, motion information, residuals, etc.

[0057] When making mode selection, if the RDO principle is used to make comparison decisions on the encoding mode, it can usually ensure the best encoding performance.

[0058] 12. Intra string copy prediction: A mode in which the decoded sample values in the same decoded image are copied to the current sample area as the predicted values of the current samples. The two-dimensional shape and the number of sample values of the area where the sample values are copied are the same as those of the current sample area.

[0059] 13. String vector: A two-dimensional vector used for the intra string copy prediction mode, and its value is the coordinate offset between the current string and the reference string, where both the current string and the reference string are in the current image.

[0060] The coding units in the string copy intra prediction mode are divided into IscPartNum parts in the raster scan order, and each part is processed in turn. The type of the i-th part is determined according to IscMatchTypeFlag[i] (i = 0 to IscPartNum - 1). If the type of the i-th part is a string, a string vector is decoded by a certain method; if the type of the i-th part is an incomplete match string and NumMatchedPixel[i] is greater than 0, a string vector is decoded by another method; otherwise, the values of the components of the unmatched pixels are directly obtained from the bitstream.

[0061] II. An enhanced motion information derivation method for the ETMVP mode will be described below

[0062] In the first step, assume that F is an adjacent prediction block of the current prediction unit E, and derive the first-stage motion vector mvFirstStage, reference index refFirstStage, and reference direction predFirstStage of the current prediction unit;

[0063] In the second step, use the reference index refFirstStage and reference direction predFirstStage to find a matching block from the reference frame;

[0064] In one implementation, assume that (Xpos, Ypos) is the upper-left coordinate of the current prediction unit in the image, (x_ctb_pos, y_ctb_pos) is the upper-left coordinate of the current CTU in the image, cu_width and cu_height are the width and height of the current prediction unit, pic_width and pic_height are the width and height of the current image, and (Mx, My) is the upper-left coordinate of the matching block in the reference frame corresponding to refFirstStage and predFirstStage in the reference frame. Then:

[0065] Mx = Clip3(((Xpos + 4) >> 3) << 3, x_ctb_pos, min(x_ctb_pos + 128 - cu_width, pic_width - cu_width))

[0066] My = Clip3(((Ypos + 4) >> 3) << 3, y_ctb_pos, min(y_ctb_pos + 128 - cu_height, pic_height - cu_height))

[0067] Exemplarily,

[0068] ">>" is a right shift operation, and "<<" is a left shift operation

[0069] min(x, y) takes the smaller value of x and y.

[0070] In the third step, determine the upper-left coordinates (Px, Py) of the matching block corresponding to the enhanced motion vector prediction mode according to EtmvpCandIdx;

[0071] Exemplarily, the upper-left coordinates of the (EtmvpCandIdx + 1)-th candidate mode matching block in the list EtmvpCandArray can be used as the upper-left coordinates (Px, Py) of the matching block corresponding to the current block.

[0072] In one implementation, the construction method of the list EtmvpCandArray is as follows:

[0073] a), Add the ETMVP mode 0 to EtmvpCandArray, and determine (Mx, My) as the upper-left coordinates of the matching block;

[0074] b), If the matching block where (Mx, My) is located does not exceed the lower boundary of the current CTU or the image, then determine whether the motion information at positions A1 and C3 is the same, and whether the motion information at positions A2 and C4 is the same. If at least one set of motion information is different, add the Etmvp mode 1 to EtmvpCandArray, and determine (Mx, My + 8) as the upper-left coordinates of the matching block; otherwise, proceed to step c); Figure 1C In, whether the motion information at positions A1 and C3 is the same, and whether the motion information at positions A2 and C4 is the same. If at least one set of motion information is different, add the Etmvp mode 1 to EtmvpCandArray, and determine (Mx, My + 8) as the upper-left coordinates of the matching block; otherwise, proceed to step c);

[0075] c), If the matching block where (Mx, My) is located does not exceed the right boundary of the current CTU or the image, then determine whether the motion information at positions A1 and B2 is the same, and whether the motion information at positions A3 and B4 is the same. If at least one set of motion information is different, add the Etmvp mode 2 to EtmvpCandArray, and determine (Mx + 8, My) as the upper-left coordinates of the matching block; otherwise, proceed to step d); Figure 1C In, whether the motion information at positions A1 and B2 is the same, and whether the motion information at positions A3 and B4 is the same. If at least one set of motion information is different, add the Etmvp mode 2 to EtmvpCandArray, and determine (Mx + 8, My) as the upper-left coordinates of the matching block; otherwise, proceed to step d);

[0076] d), If the matching block where (Mx, My) is located does not exceed the upper boundary of the current CTU or the image, then determine whether the motion information at positions A3 and C1 is the same, and whether the motion information at positions A4 and C2 is the same. If at least one set of motion information is different, add the Etmvp mode 3 to EtmvpCandArray, and determine (Mx, My - 8) as the upper-left coordinates of the matching block; otherwise, proceed to step e); Figure 1C In, whether the motion information at positions A3 and C1 is the same, and whether the motion information at positions A4 and C2 is the same. If at least one set of motion information is different, add the Etmvp mode 3 to EtmvpCandArray, and determine (Mx, My - 8) as the upper-left coordinates of the matching block; otherwise, proceed to step e);

[0077] e), If the matching block where (Mx, My) is located does not exceed the left boundary of the current CTU or the image, then determine Figure 1CWhether the motion information at positions A2 and B1 is the same, and whether the motion information at positions A4 and B3 is the same. If at least one set of motion information is different, add the Etmvp mode 4 to the EtmvpCandArray, and determine the upper left corner coordinates as (Mx - 8, My); otherwise, proceed to step f).

[0078] f) If the length of the EtmvpCandArray is less than the threshold T, perform a repeated filling operation on the last mode in the EtmvpCandArray until the length of the EtmvpCandArray is T.

[0079] Exemplarily, T = 5.

[0080] Fourth step, determine the motion information of each sub - block of the current prediction unit according to the upper left corner coordinates (Px, Py) of the matching block.

[0081] In one implementation, the implementation method of the fourth step is as follows:

[0082] a) For the current decoding unit, i = 0 to (cu_width >> 3) - 1, j = 0 to (cu_height >> 3) - 1), (i, j) is the index of the 8 * 8 sub - block within the current decoding unit, cu_width is the width of the current decoding unit, and cu_height is the height of the current decoding unit. MotionArrayLX is the motion information of the internal sub - blocks of the current decoding unit (including the motion vector MvArrayLX[i][j], the reference index RefArrayLX[i][j], and the prediction direction PredDirArrayLX[i][j]). If the current block is in a P - picture, then X is 0; if the current block is in a B - picture, then X is 0 or 1.

[0083] b) Determine whether the motion information of the 8 * 8 sub - block corresponding to the coordinates (Px+(i << 3), Py+(j << 3)) in the matching block is available. If it is available, scale the motion information to the first frame in List0 and List1 and assign it to MotionArrayLX[i][j]; if it is not available, scale the motion information mvFirstStage in the first stage to the first frame in List0 and List1 and assign it to MotionArrayLX[i][j].

[0084] III. Block Partitioning Technology in Video Coding Standards

[0085] In HEVC, a Coding Tree Unit (CTU) is recursively divided into CUs using a quadtree. Whether to use intra-coding or inter-coding is determined at the CU level of the leaf node. A CU can be further divided into two or four Prediction Units (PUs), and the same prediction information is used within the same PU. After obtaining the residual information after prediction, a CU can be further quad-divided into multiple Transform Units (TUs). For example, the current image block in this application is a PU.

[0086] However, there have been significant changes in the block partitioning technique in the newly proposed Versatile Video Coding (VVC). A partitioning structure that mixes binary trees, ternary trees, and quadtree has replaced the original partitioning mode, eliminating the distinction between the original concepts of CU, PU, and TU, and supporting a more flexible partitioning method for CUs. Among them, a CU can be square or rectangularly partitioned. The CTU first undergoes quadtree partitioning, and then the leaf nodes of the quadtree partitioning can be further partitioned into binary trees and ternary trees. Figure 2A As shown, there are five partitioning types for CUs, namely quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, and vertical ternary tree partitioning. As Figure 2B shown, the CU partitioning within a CTU can be any combination of the above five partitioning types. From the above, it can be seen that different partitioning methods result in different shapes of each PU, such as rectangles and squares of different sizes. The block partitioning involved in this application can adopt the block partitioning technique in VVC, or the block partitioning technique in HEVC, or the block partitioning techniques specified in other standards.

[0087] Due to the existence of restricted conditions for the coding of the flag bits of each mode, a certain mode can only be enabled when all conditions are met, that is, its flag bit needs to be coded. And these conditions can be known when coding the first mode (i.e., the regular merge mode). When coding the previous flag bits, the coding of the current mode flag bit can be skipped according to these conditions to save the bitrate overhead.

[0088] For example, when coding the direct mode, if it can be known based on the current conditions that all remaining modes such as UVME and AFFINE cannot be enabled, then the flag bit of the current direct mode actually does not need to be coded. In this case, the decoding end only needs to judge these known conditions to determine that all remaining modes such as UVME and AFFINE cannot be enabled, so only the direct mode can be enabled, that is, it is not necessary to decode the flag bit of the direct mode to determine that it is 1.

[0089] Please refer to Figure 3 , which is a schematic flowchart of a prediction mode decoding method provided by an embodiment of the present application. As Figure 3 shown, the prediction mode decoding method may include the following steps:

[0090] Step S300: For the current block, before decoding the binary coded information of the mode flag bit to be decoded, determine whether the current block meets the decoding-free condition of the mode flag bit to be decoded according to the specific information of the current block. If so, go to step S310; otherwise, go to step S320.

[0091] Exemplarily, the specific information may include the value of at least one obtained mode flag bit and / or the decoding information indicating whether at least one prediction mode is available.

[0092] In the embodiment of the present application, in order to avoid having to determine the value of the mode flag bit by decoding the binary coded information of the mode flag bit, before decoding the binary coded information of the mode flag bit to be decoded, it may be determined whether the current block meets the decoding-free condition of the mode flag bit to be decoded according to the specific information of the current block.

[0093] It should be noted that in the embodiment of the present application, the so-called decoding-free means that there is no need to parse the coded information from the bitstream. For example, meeting the decoding-free condition of the mode flag bit to be decoded means that there is no need to parse the coded information of the mode flag bit to be decoded from the bitstream.

[0094] The mode flag bit to be decoded refers to the mode flag bit whose value needs to be determined at the current time, and this mode flag bit to be decoded is the mode flag bit whose value needs to be determined during the process of determining the prediction mode enabled for the current block. The current block refers to the image block to be decoded currently.

[0095] For example, assume that the candidate prediction modes of the current block include prediction mode A to prediction mode D, mode flag bit 1 is used to indicate whether one of prediction mode A and prediction mode B is enabled; mode flag bit 2 is used to indicate whether mode A is enabled; mode flag bit 3 is used to indicate whether mode C is enabled. In order to determine the prediction mode enabled for the current block, it is necessary to first determine the value of mode flag bit 1, and the value of mode flag bit 2 or mode flag bit 3. The above-mentioned mode flag bits to be decoded may be mode flag bit 1, mode flag bit 2 or mode flag bit 3.

[0096] The decoding-free condition of the mode flag bit to be decoded refers to the condition under which the value of the mode flag bit to be decoded can be determined without decoding the binary coded information of the mode flag bit to be decoded.

[0097] For example, the condition for not decoding the mode flag bit to be decoded may be that all candidate prediction modes under one of the values of the mode flag bit to be decoded are unavailable.

[0098] Taking the previous example again, for mode flag bit 1, the condition for not decoding this mode flag bit may be that both prediction mode A and prediction mode B are unavailable, or both prediction mode C and prediction mode D are unavailable.

[0099] Exemplarily, the condition for not decoding the mode flag bit to be decoded may further include that the value of the mode flag bit before the mode flag bit to be decoded does not point to the mode flag bit to be decoded (i.e., the prediction mode enabled for the current block is not any of the candidate prediction modes under the values of the mode flag bit to be decoded), or the value of the mode flag bit before the mode flag bit to be decoded points to the mode flag bit to be decoded (i.e., the prediction mode enabled for the current block is one of the candidate prediction modes under the values of the mode flag bit to be decoded), and all candidate prediction modes under one of the values of the mode flag bit to be decoded are unavailable.

[0100] Taking the previous example again, assume that when the value of mode flag bit 1 is the first value, it indicates that both prediction mode A and prediction mode B are not enabled. That is, at this time, it is necessary to determine whether prediction mode C is enabled for the current block based on the value of mode flag bit 3. Then, for mode flag bit 3, the condition for not decoding this mode flag bit 3 may include that the value of mode flag bit 1 is the second value (at this time, the value of mode flag bit 3 is the value used to indicate that prediction mode C is not enabled), or the value of mode flag bit 1 is the first value, and either prediction mode C or prediction mode D is unavailable.

[0101] For example, if prediction mode D is unavailable, then the value of mode flag bit 3 is the value used to indicate that prediction mode C is enabled.

[0102] Step S310: Determine that the binary value of the mode flag bit to be decoded is the first value or the second value according to this specific information.

[0103] In the embodiments of the present application, if the current block meets the condition for not decoding the mode flag bit to be decoded, the step of decoding the binary encoded information of the mode flag bit to be decoded may be skipped, that is, the binary encoded information of the mode flag bit to be decoded is not decoded, but rather it is determined that the binary value of the mode flag bit to be decoded is the first value or the second value according to the specific information of the current block.

[0104] Exemplarily, when it is determined according to this specific information that all candidate prediction modes under the first value of the binary value of the mode flag bit to be decoded are unavailable, it may be determined that the binary value of the mode flag bit to be decoded is the second value.

[0105] Exemplarily, the first value is 0 and the second value is 1; or, the first value is 1 and the second value is 0.

[0106] For ease of understanding and description, in the following, an example where the first value is 0 and the second value is 1 is used.

[0107] Step S320: Read the binary-coded information of the mode flag to be decoded, decode the coded information, and determine that the binary value of the mode flag to be decoded is the first value or the second value.

[0108] In the embodiments of the present application, if the current block does not meet the decoding-free condition of the mode flag to be decoded, the binary value of the mode flag to be decoded can be determined to be the first value or the second value by decoding the binary-coded information of the mode flag to be decoded.

[0109] Exemplarily, the encoding and decoding method of the mode flag to be decoded may include context-based arithmetic binary encoding and decoding or context-free binary encoding and decoding.

[0110] It should be noted that in the embodiments of the present application, Figure 3 In the shown process, it is determined whether to decode the binary-coded information of the mode to be decoded by judging whether the current block meets the decoding-free condition of the mode flag to be decoded. However, in practice, it can also be determined to decode the binary-coded information of the mode to be decoded by setting a decoding condition and judging whether the current block meets the decoding condition of the mode flag to be decoded.

[0111] Exemplarily, Figure 3 The shown process can also be described as: for the current block, before decoding the binary-coded information of the mode flag to be decoded, judge whether the current block meets the decoding condition of the mode flag to be decoded according to the specific information of the current block. If the current block meets the decoding condition of the mode flag to be decoded, read the binary-coded information of the mode flag to be decoded, decode the coded information, and determine that the binary value of the mode flag to be decoded is the first value or the second value; if the current block does not meet the decoding condition of the mode flag to be decoded, determine that the value of the mode flag to be decoded is the first value or the second value according to the specific information. The specific information includes the values of at least one obtained mode flag and / or the decoding information of whether at least one prediction mode is available.

[0112] Exemplarily, for the current block, if the current block meets the decoding-free condition of the mode flag to be decoded, it can also be described as not meeting the decoding condition of the mode flag to be decoded;

[0113] If the current block does not meet the decoding-free condition of the mode flag to be decoded, it can also be described as meeting the decoding condition of the mode flag to be decoded.

[0114] Therefore, in the embodiments of the present application, the description of whether the current block meets the decoding-free condition of the to-be-decoded mode flag can be replaced by whether the current block meets the decoding condition of the to-be-decoded flag. The difference between the two is that the execution process of the branch with the judgment result of yes in the former is the execution process of the branch with the judgment result of no in the latter; the execution process of the branch with the judgment result of no in the former is the execution process of the branch with the judgment result of yes in the latter.

[0115] It can be seen that in Figure 3 In the shown process, before decoding the binary-coded information of the to-be-decoded mode flag, it is determined whether the current meets the decoding-free condition of the to-be-decoded mode flag based on the specific information of the current block. When the current block meets the decoding-free condition of the to-be-decoded mode flag, instead of decoding the binary-coded information of the to-be-decoded mode flag, the binary value of the to-be-decoded mode flag is determined according to the specific information, thus achieving the determination of the binary value of the to-be-decoded mode flag without decoding the binary-coded information of the to-be-decoded mode flag. Therefore, coding bits can be saved and the coding and decoding performance can be improved.

[0116] In some embodiments, in step S300, before determining whether the current block meets the decoding-free condition of the to-be-decoded mode flag according to the specific information of the current block, it may further include:

[0117] Before decoding the binary-coded information of the control switch flag of the first target prediction mode, obtain and determine whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block;

[0118] If the current block meets the decoding-free condition of the first target prediction mode, skip the step of decoding the binary-coded information of the control switch flag of the first target prediction mode, and determine that the binary value of the control switch flag of the first target prediction mode is the first value;

[0119] If the current block does not meet the decoding-free condition of the first target prediction mode, execute the above step of decoding the binary-coded information of the control switch flag of the first target prediction mode;

[0120] If the decoded binary value of the control switch flag of the first target prediction mode is the first value, execute the above step of determining whether the current block meets the decoding-free condition of the to-be-decoded mode flag according to the specific information of the current block.

[0121] Exemplarily, considering the coding and decoding process, when determining that a prediction mode is enabled or when determining that the prediction mode is not enabled, the candidate prediction modes of the current block are usually different.

[0122] For example, taking the skip mode as an example, when the skip mode is enabled, the candidate prediction modes may include the regular skip mode; when the skip mode is not enabled, the candidate prediction modes do not include the regular skip mode.

[0123] Exemplarily, before determining whether the current block meets the decoding-free condition of the mode flag bit to be decoded according to the specific information of the current block, it is also possible to determine whether the first target prediction mode is enabled for the current block.

[0124] Exemplarily, if the first target prediction mode is not enabled, it is not necessary to decode the binary-coded information of the mode flag bit to be decoded in step S300.

[0125] In order to avoid having to determine whether the first target prediction mode is enabled by decoding the binary-coded information of the control switch flag bit of the first target prediction mode, before decoding the binary-coded information of the control switch flag bit of the first target prediction mode, it is possible to obtain and judge whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block.

[0126] If the current block meets the decoding-free condition of the mode flag bit of the first target prediction mode, it is not necessary to decode the binary-coded information of the control switch flag bit of the first target prediction mode, and it is determined that the binary value of the control switch flag bit of the first target prediction mode is the first value.

[0127] In this application, the meaning of decoding-free or decoding-free for any mode flag bit is that there is no need to read the binary-coded information of the mode flag bit and no need to obtain the value of the mode flag bit through decoding, but directly deduce the value of the mode flag bit. The meaning of needing to decode or decode for any mode flag bit in this application is to obtain the value of the mode flag bit by reading the binary-coded information of the mode flag bit from the bitstream and through decoding.

[0128] Exemplarily, the decoding-free condition of the first target prediction mode may include the condition of not enabling the first target prediction mode, and this first value is the value used to indicate not enabling the first target prediction mode.

[0129] It should be noted that in this case, it is not necessary to decode the binary-coded information of the mode flag bit to be decoded in step S300.

[0130] If the current block does not meet the decoding-free condition of the first target prediction mode, then decode the binary-coded information of the control switch flag bit of the first target prediction mode to determine the binary value of the control switch flag bit of the first target prediction mode.

[0131] If the binary value of the control switch flag of the first target prediction mode is decoded as the second value, it is determined to enable the first target prediction mode. At this time, the binary value of the mode flag to be decoded can be determined according to the process shown in Figure 3 the process shown.

[0132] It should be noted that if the binary value of the control switch flag of the first target prediction mode is not decoded, for example, there is no binary encoded information of the control switch flag of the first target prediction mode in the bitstream, or the binary value of the control switch flag of the first target prediction mode is decoded as the second value, it is determined not to enable the first target prediction mode. In this case, it is not necessary to decode the binary encoded information of the mode flag to be decoded in step S300.

[0133] In one example, before obtaining and determining whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block, it may further include:

[0134] Before decoding the binary encoded information of the control switch flag of the second target prediction mode, obtain and determine whether the current block meets the decoding-free condition of the second target prediction mode according to the decoding information of the current block;

[0135] If the current block meets the decoding-free condition of the second target prediction mode, skip the step of decoding the binary encoded information of the control switch flag of the second target prediction mode, and determine that the binary value of the control switch flag of the second target prediction mode is the first value;

[0136] If the current block does not meet the decoding-free condition of the second target prediction mode, execute the step of decoding the binary encoded information of the control switch flag of the second target prediction mode;

[0137] If the binary value of the control switch flag of the second target prediction mode is decoded as the second value, execute the step of obtaining and determining whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block.

[0138] Exemplarily, there is a certain order for whether different prediction modes are enabled.

[0139] For example, for the skip mode and the direct mode, when the skip mode is enabled, the direct mode will not be enabled; when the skip mode is not enabled, it is necessary to consider whether the direct mode is enabled.

[0140] Exemplarily, the first target prediction mode is a prediction mode that needs to be determined whether to be enabled only when the second target prediction mode is not enabled.

[0141] To avoid having to determine whether the second target prediction mode is enabled for the current block by decoding the binary-encoded information of the control switch flag bit of the second target prediction mode, before decoding the binary-encoded information of the control switch flag bit of the second target prediction mode, it is possible to obtain and determine whether the current block meets the decoding-free condition of the second target prediction mode based on the decoded information of the current block.

[0142] If the current block meets the decoding-free condition of the second target prediction mode, then it is not necessary to decode the binary-encoded information of the control switch flag bit of the second target prediction mode, and it is determined that the binary value of the control switch flag bit of the second target prediction mode is the value used to indicate that the second target prediction mode is not enabled (i.e., the above first value). At this time, it is possible to determine whether to enable the first target prediction mode in the manner described in the above embodiments.

[0143] If the current block does not meet the decoding-free condition of the second target prediction mode, then decode the binary-encoded information of the control switch flag bit of the second target prediction mode to determine the binary value of the control switch flag bit of the second target prediction mode.

[0144] If the decoded binary value of the control switch flag bit of the second target prediction mode is the second value, then determine that the second target prediction mode is enabled. At this time, it is possible to determine that the first target prediction mode is not enabled.

[0145] It should be noted that if the binary value of the control switch flag bit of the second target prediction mode is not decoded, for example, there is no binary-encoded information of the control switch flag bit of the second target prediction mode in the bitstream, or the decoded binary value of the control switch flag bit of the second target prediction mode is the second value, then determine that the second target prediction mode is not enabled. In this case, determine whether to enable the first target prediction mode in the manner described in the above embodiments.

[0146] In one example, the above first target prediction mode is the skip mode.

[0147] The above at least one prediction mode includes one or more prediction modes among the candidate prediction modes when the skip mode is enabled.

[0148] Exemplarily, taking the first target prediction mode as the skip mode as an example, the candidate prediction modes when the skip mode is enabled can at least include one or more of the conventional skip mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode.

[0149] Figure 3 At least one prediction mode in the shown process can include one or more prediction modes among the candidate prediction modes when the skip mode is enabled.

[0150] In one example, when the first target prediction mode is the skip mode, the decoding-free conditions for the first target prediction mode include one or more of the following:

[0151] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0152] The sum of the width and height of the current block is less than a first threshold.

[0153] Exemplarily, considering that if the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode, the current block cannot use an inter prediction mode including the skip mode.

[0154] In addition, considering that blocks enabled with the skip mode usually have certain limitations in size.

[0155] Exemplarily, it is possible to determine whether the current block meets the decoding-free conditions for the skip mode based on the mode used by the current block and / or the size of the current block.

[0156] If the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode, and / or the sum of the width and height of the current block is less than a first threshold (which can be set according to actual requirements), it is determined that the current block meets the decoding-free conditions for the skip mode.

[0157] In one example, the first threshold is 16.

[0158] It should be noted that in the embodiments of the present application, if the current block does not meet the decoding-free conditions for the first target prediction mode, it is also possible to determine that the current block meets the decoding conditions for the first target prediction mode. At this time, it is possible to determine whether the first target prediction mode is enabled according to other strategies. For example, by decoding the binary coded information of the control switch flag bit of the first target prediction mode.

[0159] In one example, the first target prediction mode is the direct mode, and the second target prediction mode is the skip mode.

[0160] The above at least one prediction mode is one or more prediction modes among the candidate prediction modes when the direct mode is enabled.

[0161] Exemplarily, taking the first target prediction mode as the direct mode and the second target prediction mode as the skip mode as an example, the candidate prediction modes when the direct mode is enabled at least include one or more of the conventional direct mode, the InterPF mode, the Affine mode, the UMVE mode, the AWP mode, and the ETMVP mode.

[0162] Figure 3 At least one prediction mode in the shown process may include one or more prediction modes among the candidate prediction modes when the direct mode is enabled.

[0163] In one example, when the first target prediction mode is the direct mode, the non-decoding conditions for the first target prediction mode include one or more of the following:

[0164] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0165] The sum of the width and height of the current block is less than a second threshold;

[0166] When the second target prediction mode is the skip mode, the non-decoding conditions for the second target prediction mode include one or more of the following:

[0167] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0168] The sum of the width and height of the current block is less than a third threshold.

[0169] Exemplarily, considering that if the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode, then the current block cannot use an inter prediction mode including the direct mode.

[0170] In addition, considering that blocks with the direct mode enabled usually also have certain limitations in size.

[0171] Exemplarily, it can be determined whether the current block meets the non-decoding conditions for the direct mode based on the mode used by the current block and / or the size of the current block.

[0172] If the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode, and / or the sum of the width and height of the current block is less than a second threshold (which can be set according to actual needs), it is determined that the current block meets the non-decoding conditions for the direct mode.

[0173] In one example, the second threshold is 16.

[0174] Exemplarily, considering that if the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode, then the current block cannot use an inter prediction mode including the skip mode.

[0175] In addition, considering that blocks with the skip mode enabled usually also have certain limitations in size.

[0176] Exemplarily, it can be determined whether the current block meets the decoding exemption condition of the skip mode according to the mode used by the current block and / or the size of the current block.

[0177] If the current block uses an ordinary intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode, and / or when the sum of the width and height of the current block is less than a third threshold (which can be set according to actual requirements), it is determined that the current block meets the decoding exemption condition of the skip mode.

[0178] In one example, the third threshold is 16.

[0179] In some embodiments, for any one of the above at least one prediction mode, the decoding information indicating whether it is available includes one or more of switch state information, current block size information, and frame type information.

[0180] Exemplarily, considering that the availability of a prediction mode is usually restricted by one or more of conditions such as switches (such as upper-layer switches like sequence-level switches and picture-level switches), block size, and frame type, when determining whether a prediction mode is available, it can be determined according to one or more of the size restriction conditions, frame type restriction conditions, and switch restriction conditions corresponding to the mode.

[0181] Therefore, for any prediction mode, it can be determined whether it is available based on one or more of the corresponding switch state information, current block size information, and frame type information.

[0182] In one example, for any one of the at least one prediction mode, determining whether it is available based on the decoding information indicating whether it is available includes:

[0183] Based on the decoding information indicating whether it is available for this prediction mode, determine whether the current block meets the restriction conditions allowed to be enabled for this prediction mode;

[0184] If it is met, it is determined that this prediction mode is available; otherwise, it is determined that this prediction mode is unavailable.

[0185] Example 1: When this prediction mode is the UMVE mode, the restriction conditions allowed to be enabled include that the sequence-level switch of the UMVE mode is in the on state.

[0186] Exemplarily, for the UMVE mode, it can be determined whether it meets the restriction conditions allowed to be enabled according to the switch restriction conditions.

[0187] If the sequence-level switch of the UMVE mode is in the on state, it is determined that the restriction conditions allowed to be enabled for the UMVE mode are met, that is, the UMVE mode is available; otherwise, it is determined that the restriction conditions allowed to be enabled for the UMVE mode are not met, that is, the UMVE mode is unavailable.

[0188] Example 2: When the prediction mode is the AWP mode, the enabling restrictions it allows include one or more of the following:

[0189] The sequence-level switch of the AWP mode is in the on state, the product of the width and height of the current block is greater than or equal to the first size threshold, the width of the current block is less than or equal to the first width threshold, the height of the current block is less than or equal to the first height threshold, and the frame type of the frame to which the current block belongs is a B frame.

[0190] Exemplarily, for the AWP mode, it can be determined whether it meets the enabling restrictions according to the switch restriction conditions, size restriction conditions, and frame type restriction conditions.

[0191] If the sequence-level switch of the AWP mode is in the on state, and the product of the width and height of the current block is greater than or equal to the first size threshold, the width of the current block is less than or equal to the first width threshold, the height of the current block is less than or equal to the first height threshold, and the type of the frame to which the current block belongs is a B frame, it is determined that the enabling restrictions of the AWP mode are met, that is, the AWP mode is available; otherwise, if any of the above conditions is not met, such as the sequence-level switch of the AWP mode is in the off state, or the product of the width and height of the current block is less than the first size threshold, it is determined that the enabling restrictions of the AWP mode are not met, that is, the AWP mode is unavailable.

[0192] It should be noted that in some examples, "the frame type to which it belongs is a B frame" in the above enabling restrictions can also be replaced by "the type of the slice to which it belongs is SLICE_B".

[0193] Example 3: When the prediction mode is the ETMVP mode, the enabling restrictions it allows include one or more of the following:

[0194] The sequence-level switch of the ETMVP mode is in the on state, the width of the current block is greater than or equal to the second width threshold, and the height of the current block is greater than or equal to the second height threshold.

[0195] Exemplarily, for the ETMVP mode, it can be determined whether it meets the enabling restrictions according to the switch restriction conditions and size restriction conditions.

[0196] If the sequence-level switch of the ETMVP mode is in the on state, and the width of the current block is greater than or equal to the second width threshold, and the height of the current block is greater than or equal to the second height threshold, it is determined that the enabling restrictions of the ETMVP mode are met, that is, the ETMVP mode is available; otherwise, if any of the above conditions is not met, such as the sequence-level switch of the ETMVP mode is in the off state, or the width of the current block is less than the second width threshold, it is determined that the enabling restrictions of the ETMVP mode are not met, that is, the ETMVP mode is unavailable.

[0197] Example 4: When the prediction mode is the Affine mode, the enabling restrictions it allows include one or more of the following:

[0198] The sequence-level switch of the Affine mode is in the on state, the width of the current block is greater than or equal to the third width threshold, and the height of the current block is greater than or equal to the third height threshold.

[0199] Exemplarily, for the Affine mode, it can be determined whether it meets the enabling restrictions according to the switch restriction conditions and the size restriction conditions.

[0200] If the sequence-level switch of the Affine mode is in the on state, the width of the current block is greater than or equal to the third width threshold, and the height of the current block is greater than or equal to the third height threshold, it is determined that the enabling restrictions of the Affine mode are met, that is, the Affine mode is available; otherwise, if any of the above conditions is not met, such as the sequence-level switch of the Affine mode is in the off state, or the width of the current block is less than the third width threshold, etc., it is determined that the enabling restrictions of the Affine mode are not met, that is, the Affine mode is not available.

[0201] Example 5: When the prediction mode is the InterPF mode, the enabling restrictions it allows include one or more of the following;

[0202] The sequence-level switch of the InterPF mode is in the on state, the product of the width and height of the current block is greater than or equal to the second size threshold, the width of the current block is less than or equal to the fourth width threshold, and the height of the current block is less than or equal to the fourth height threshold.

[0203] Exemplarily, for the InterPF mode, it can be determined whether it meets the enabling restrictions according to the switch restriction conditions and the size restriction conditions.

[0204] If the sequence-level switch of the InterPF mode is in the on state, the product of the width and height of the current block is greater than or equal to the second size threshold, the width of the current block is less than or equal to the fourth width threshold, and the height of the current block is less than or equal to the fourth height threshold, it is determined that the enabling restrictions of the InterPF mode are met, that is, the InterPF mode is available; otherwise, if any of the above conditions is not met, such as the sequence-level switch of the InterPF mode is in the off state, or the width of the current block is greater than the fourth width threshold, etc., it is determined that the enabling restrictions of the Affine mode are not met, that is, the InterPF mode is not available.

[0205] It should be noted that when the enabling conditions allowed by a prediction mode (such as the AWP mode) include multiple conditions, if any one of the multiple conditions is not satisfied, it can be understood that the disabling condition of the prediction mode is satisfied. That is, when any one of the multiple conditions is not satisfied, it is determined that the disabling condition of the prediction mode is satisfied, and the prediction mode is unavailable.

[0206] In addition, for the case of "equal" in the above conditions, such as the product of the width and height of the current block being equal to the first size threshold, it can be used as the enabling condition described in the above embodiments, and in practical applications, it can also be used as the disabling condition. For example, when the product of the width and height of the current block is equal to the first size threshold, it can also be determined that the disabling condition of the AWP mode is satisfied, and it is determined not to enable the AWP mode.

[0207] Please refer to Figure 4 , which is a schematic flowchart of a prediction mode encoding method provided by an embodiment of the present application. As Figure 4 shown, the prediction mode encoding method may include the following steps:

[0208] Step S400: For the current block, before writing the binary encoding information of the to-be-encoded mode flag bit into the bitstream, determine whether the current block satisfies the non-encoding condition of the to-be-encoded mode flag bit. If so, go to step S410; otherwise, go to step S420.

[0209] Step S410: Skip the step of writing the binary encoding information of the to-be-encoded mode flag bit into the bitstream.

[0210] Step S420: Write the binary encoding information of the to-be-encoded mode flag bit into the bitstream.

[0211] Exemplarily, Figure 4 the implementation of the shown process can be referred to the relevant description in the process shown in Figure 3 , and the embodiments of the present application will not elaborate here.

[0212] Similarly to the decoding end process, in the encoding end process, whether the current block satisfies the non-encoding condition of the to-be-encoded mode flag bit can also be replaced with whether the current block satisfies the encoding condition of the to-be-encoded mode flag bit. The difference between the two is that the execution process of the branch with the judgment result of yes in the former is the execution process of the branch with the judgment result of no in the latter; the execution process of the branch with the judgment result of no in the former is the execution process of the branch with the judgment result of yes in the latter.

[0213] Exemplarily, Figure 4The process shown can be described as follows: For the current block, before writing the binary-encoded information of the bit to be encoded for the mode flag into the bitstream, it is determined whether the current block meets the encoding condition for the bit to be encoded for the mode flag. If the current block meets the encoding condition for the bit to be encoded for the mode flag, the binary-encoded information of the bit to be encoded for the mode flag is written into the bitstream; if the current block does not meet the encoding condition for the bit to be encoded for the mode flag, the step of writing the binary-encoded information of the bit to be encoded for the mode flag into the bitstream is skipped.

[0214] In a possible implementation, in step S400, before determining whether the current block meets the no-encoding condition for the bit to be encoded for the mode flag, it may further include:

[0215] Before writing the binary-encoded information of the control switch flag bit of the first target prediction mode into the bitstream, it is determined whether the current block meets the no-decoding condition for the first target prediction mode;

[0216] If the current block meets the no-decoding condition for the first target prediction mode, the step of writing the binary-encoded information of the control switch flag bit of the first target prediction mode into the bitstream is skipped, and the binary value of the control switch flag bit of the first target prediction mode is determined to be the first value;

[0217] If the current block does not meet the no-decoding condition for the first target prediction mode, the step of writing the binary-encoded information of the control switch flag bit of the first target prediction mode into the bitstream is executed;

[0218] If the binary value of the control switch flag bit of the first target prediction mode is the second value, the step of determining whether the current block meets the no-encoding condition for the bit to be encoded for the mode flag is determined to be executed.

[0219] In a possible implementation, before the above determining whether the current block meets the no-decoding condition for the first target prediction mode, it further includes:

[0220] Before writing the binary-encoded information of the control switch flag bit of the second target prediction mode into the bitstream, it is determined whether the current block meets the no-decoding condition for the second target prediction mode;

[0221] If the current block meets the no-decoding condition for the second target prediction mode, the step of writing the binary-encoded information of the control switch flag bit of the second target prediction mode into the bitstream is skipped, and the binary value of the control switch flag bit of the second target prediction mode is determined to be the first value;

[0222] If the current block does not meet the no-decoding condition for the second target prediction mode, the step of writing the binary-encoded information of the control switch flag bit of the second target prediction mode into the bitstream is executed;

[0223] If the binary value of the control switch flag bit of the second target prediction mode is the second value, determine to execute the step of judging whether the current block meets the disabling condition of the first target prediction mode.

[0224] In a possible implementation, the first target prediction mode is the skip mode;

[0225] The above at least one prediction mode includes one or more prediction modes among the candidate prediction modes when the skip mode is enabled;

[0226] The candidate prediction modes when the skip mode is enabled include at least one or more of the regular skip mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode.

[0227] In a possible implementation, the decoding-free conditions of the first target prediction mode include one or more of the following:

[0228] The current block uses the ordinary intra prediction mode, block copy intra prediction mode, or string copy intra prediction mode;

[0229] The sum of the width and height of the current block is less than the first threshold.

[0230] In a possible implementation, the first threshold is 16.

[0231] In a possible implementation, the first target prediction mode is the direct mode, and the second target prediction mode is the skip mode;

[0232] The above at least one prediction mode is one or more prediction modes among the candidate prediction modes when the direct mode is enabled;

[0233] The candidate prediction modes when the direct mode is enabled include at least one or more of the regular direct mode, InterPF mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode.

[0234] In a possible implementation, the decoding-free conditions of the first target prediction mode include one or more of the following:

[0235] The current block uses the ordinary intra prediction mode, block copy intra prediction mode, or string copy intra prediction mode;

[0236] The sum of the width and height of the current block is less than the second threshold;

[0237] The decoding-free conditions of the second target prediction mode include one or more of the following:

[0238] The current block uses an ordinary intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0239] The sum of the width and height of the current block is less than a third threshold.

[0240] In a possible implementation, the second threshold is 16, and / or the third threshold is 16.

[0241] In a possible implementation, for any one of the at least one prediction mode, the decoding information indicating whether it is available includes one or more of switch state information, size information of the current block, and frame type information.

[0242] In a possible implementation, for any one of the at least one prediction mode above, determining whether it is available based on the decoding information indicating whether it is available includes:

[0243] Based on the decoding information indicating whether it is available, determine whether the current block meets the limiting conditions allowed for enabling this prediction mode;

[0244] If it meets the conditions, determine that this prediction mode is available; otherwise, determine that this prediction mode is unavailable;

[0245] When this prediction mode is the UMVE mode, the limiting conditions allowed for enabling it include that the sequence-level switch of the UMVE mode is in the on state;

[0246] When this prediction mode is the AWP mode, the limiting conditions allowed for enabling it include one or more of the following:

[0247] The sequence-level switch of the AWP mode is in the on state, the product of the width and height of the current block is greater than or equal to a first size threshold, the width of the current block is less than or equal to a first width threshold, the height of the current block is less than or equal to a first height threshold, and the type of the slice to which the current block belongs is SLICE_B;

[0248] When this prediction mode is the ETMVP mode, the limiting conditions allowed for enabling it include one or more of the following:

[0249] The sequence-level switch of the ETMVP mode is in the on state, the width of the current block is greater than or equal to a second width threshold, and the height of the current block is greater than or equal to a second height threshold;

[0250] When this prediction mode is the Affine mode, the limiting conditions allowed for enabling it include one or more of the following:

[0251] The sequence-level switch including the Affine mode is in the on state, the width of the current block is greater than or equal to a third width threshold, and the height of the current block is greater than or equal to a third height threshold;

[0252] When the prediction mode is the InterPF mode, the enabling restriction conditions allowed include one or more of the following;

[0253] The sequence-level switch of the InterPF mode is in the on state, the product of the width and height of the current block is greater than or equal to the second size threshold, the width of the current block is less than or equal to the fourth width threshold, and the height of the current block is less than or equal to the fourth height threshold.

[0254] It should be noted that the encoding process and the decoding process are corresponding. For the specific implementation of each embodiment in the above encoding process, reference can be made to the relevant descriptions in the above decoding process, which will not be elaborated in this embodiment of the present application.

[0255] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, the technical solutions provided in the embodiments of the present application will be described below in conjunction with specific embodiments.

[0256] To save the overhead of encoding flag bits, there are usually some restriction conditions for the encoding of each flag bit currently. Only when certain restriction conditions are met will the corresponding flag bit be encoded. For example, for the merge / skip mode, the restriction conditions for the encoding of the flag bits of its 5 modes are as follows:

[0257] Table 1. Restriction conditions available for each mode in the current block

[0258]

[0259] Analysis reveals that there is still redundancy in the above method: Since there are restriction conditions for the encoding of the flag bits (i.e., the above control switch flag bits) of each prediction mode, only when all the restriction conditions are met can a certain prediction mode be possibly enabled, that is, its flag bit needs to be encoded. And these restriction conditions can be determined when encoding the first prediction mode (i.e., the regular merge mode). When encoding the previous flag bits, the encoding of the flag bits of the current prediction mode can be skipped according to these restriction conditions to save the bitrate overhead.

[0260] For example, when encoding the direct mode, if it is known based on the current conditions that all the remaining prediction modes such as the UVME mode and the Affine mode cannot be enabled, then the flag bit of the current direct mode may not be encoded. In this case, the decoding end only needs to judge these known conditions to determine that all the remaining prediction modes such as the UVME mode and the Affine mode cannot be enabled, so only the direct mode can be enabled, that is, the value 1 of the flag bit of the direct mode can be determined without decoding the flag bit of the direct mode.

[0261] The objective of the embodiments of this application is to propose a new binarization method to reduce the average code length, and at the same time, combine the following redundancy removal method to save the coding bit overhead of these mode flag bits:

[0262] If there are N sub-prediction modes for the current prediction mode, only one sub-mode is allowed to exist for the current prediction mode, and the coding of the mode flag bits is carried out sequentially according to the agreed order. Then, when coding the flag bits of the current sub-mode, determine the number of subsequent enabled sub-modes based on the current conditions. If the number is 0, there is no need to code the flag bits of the current sub-mode (the current sub-mode must be enabled).

[0263] Exemplarily, for prediction modes with a relatively high usage probability, their mode flag bits use shorter codewords, and for prediction modes with a relatively low usage probability, their mode flag bits use longer codewords.

[0264] In addition, when performing the parsing of the current prediction mode, based on the restricted conditions or disabled conditions allowed for the prediction mode, it is indeed necessary to read the code stream to perform the parsing of the mode flag bits, or directly obtain the value of the mode flag through derivation.

[0265] The following uses specific embodiments to illustrate the implementation of prediction mode encoding and decoding.

[0266] Embodiment 1

[0267] Prediction mode decoding process:

[0268] For the current block, determine whether it is necessary to decode the current mode flag bits. If not, derive the value of the current mode flag bits, such as 1 or 0; if necessary, read the code stream and decode the value of the current mode flag bits as 1 or 0.

[0269] Embodiment 2

[0270] Prediction mode encoding process:

[0271] For the current block, determine whether it is necessary to encode the current mode flag bit code stream. If not, skip the step of writing the encoding information of the current mode flag bits into the code stream; if necessary, encode the current mode flag bits and write the encoding information into the code stream.

[0272] Exemplarily, the above encoding and decoding methods for mode flag bits include context-based arithmetic binary encoding and decoding or context-free binary encoding and decoding.

[0273] Embodiment 3

[0274] Decoding process of the mode flag bit (skip_flag) of the skip mode:

[0275] Skip mode flag skip_flag: A binary variable. A value of '1' indicates that the current coding unit enables the skip mode; a value of '0' indicates that the skip mode is not enabled.

[0276] Exemplarily, if the skip_flag does not exist in the bitstream, the value of skip_flag is equal to 0.

[0277] Exemplarily, the skip mode means skipping the residual encoding and decoding. That is, when skip_flag is 1, there is no need to perform the encoding and decoding of the residual (for example, at the decoding end, processes such as the inverse transform, inverse quantization, and decoding of the residual do not need to be performed, and only the predicted value needs to be obtained).

[0278] If skip_flag is 1, the InterPF mode cannot be enabled.

[0279] Method 3.1

[0280] If the current block uses ordinary intra prediction or block copy intra prediction or string copy intra prediction (i.e., satisfies the skip mode disabling condition), then there is no need to decode the encoding information of skip_flag, and it is determined that the value of skip_flag is equal to 0 (i.e., the above first value).

[0281] Otherwise, decode the encoding information of skip_flag to determine the value of skip_flag.

[0282] Method 3.2

[0283] If the current block uses ordinary intra prediction or block copy intra prediction or string copy intra prediction, or, the width plus height of the current block is less than the threshold WH1 (i.e., the above first threshold) (i.e., satisfies the skip mode disabling condition), then there is no need to decode the encoding information of skip_flag, and it is determined that the value of skip_flag is equal to 0 (i.e., the above first value).

[0284] Otherwise, decode the encoding information of skip_flag to determine the value of skip_flag.

[0285] Exemplarily, WH1 is 16 in Method 3.2.

[0286] The following describes the prediction mode decoding process for the case where the value of skip_flag is 1 in combination with an embodiment.

[0287] Embodiment 4

[0288] Assume that the mode flag bits whose values are to be determined (which can also be called mode index information) include umve_awp_etmvp_flag, affine_flag, etmvp_flag, and awp_flag as examples. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 4.1:

[0289] Table 4.1

[0290]

[0291] Its corresponding binary tree diagram can be as Figure 5A shown.

[0292] Exemplarily, for umve_awp_etmvp_flag, affine_flag, etmvp_flag, and awp_flag, when the conditions shown in Table 4.2 are met, it is necessary to decode the encoding information of the corresponding mode flag bit; otherwise, the process of decoding the encoding information of the corresponding mode flag bit can be skipped, and the value of the corresponding mode flag bit can be derived.

[0293] Exemplarily, the "meeting the conditions" described in Table 4.2 is the decoding condition of the corresponding mode flag bit. When this condition is not met, it can be said that the current block meets the non-decoding condition of the corresponding mode flag bit.

[0294] For example, when the condition UMVEAvailable||AWPAvailable||ETMVPAvailable is not met, that is, UMVEAvailable is 0, and AWPAvailable is 0, and ETMVPAvailable is 0, it is determined that the current block meets the non-decoding condition of the flag bit umve_awp_etmvp_flag. At this time, there is no need to decode the encoding information of umve_awp_flag, and the value of umve_awp_flag can be determined to be 0.

[0295] Exemplarily, "||" represents the condition "or"; "&&" represents the condition "and" (which can also be called "and"); UMVEAvailable being 0 means the UMVE mode is unavailable, and UMVEAvailable being 1 means the UMVE mode is available. The same applies to other modes.

[0296] Table 4.2

[0297]

[0298] Exemplarily, the limiting conditions for enabling each prediction mode are as follows:

[0299] 4.1. UMVEAvailable = sh_UmveEnableFlag

[0300] sh_UmveEnableFlag is the sequence - level switch for the UMVE mode. When the sequence - level switch of the UMVE mode is in the on state, sh_UmveEnableFlag has a value of 1; when the sequence - level switch of the UMVE mode is in the off state, sh_UmveEnableFlag has a value of 0.

[0301] When sh_UmveEnableFlag has a value of 1, that is, when the restricted conditions for enabling the UMVE mode are met, UMVEAvailable has a value of 1 and the UMVE mode is available;

[0302] When sh_UmveEnableFlag has a value of 0, that is, when the restricted conditions for enabling the UMVE mode are not met, UMVEAvailable has a value of 0 and the UMVE mode is not available.

[0303] 4.2. AWPAvailable = sh_AwpEnableFlag && (width * height >= TH_SIZE1) && (width <= TH_W1) && (height <= TH_H1) && the current frame type is B - frame

[0304] sh_AwpEnableFlag is the sequence - level switch for the AWP mode. When the sequence - level switch of the AWP mode is in the on state, sh_AwpEnableFlag has a value of 1; when the sequence - level switch of the AWP mode is in the off state, sh_AwpEnableFlag has a value of 0;

[0305] When the product of the width and height of the current block is greater than or equal to TH_SIZE1 (i.e., the first size threshold mentioned above), (width * height >= TH_SIZE1) has a value of 1; when the product of the width and height of the current block is less than TH_SIZE1, (width * height >= TH_SIZE1) has a value of 0;

[0306] When the width of the current block is less than or equal to TH_W1 (i.e., the first width threshold mentioned above), (width <= TH_W1) has a value of 1; when the width of the current block is greater than TH_W1, (width <= TH_W1) has a value of 0;

[0307] When the height of the current block is less than or equal to TH_H1 (i.e., the first height threshold mentioned above), (height <= TH_H1) has a value of 1; when the height of the current block is greater than TH_H1, (height <= TH_H1) has a value of 0;

[0308] When the frame to which the current block belongs is a B frame, the current frame type is B and its value is 1; when the frame type of the frame to which the current block belongs is not a B frame, the current frame type is B and its value is 0.

[0309] When sh_AwpEnableFlag, (width * height >= TH_SIZE1), (width <= TH_W1), (height <= TH_H1), and the type of the slice to which the current block belongs is not SLICE_B all have a value of 1, that is, when the limiting conditions for enabling the AWP mode are met, AWPAvailable has a value of 1 and the AWP mode is available;

[0310] When sh_AwpEnableFlag, (width * height >= TH_SIZE1), (width <= TH_W1), (height <= TH_H1), or the type of the slice to which the current block belongs is not SLICE_B has a value of 0, that is, when the limiting conditions for enabling the AWP mode are not met, AWPAvailable has a value of 0 and the AWP mode is not available.

[0311] Exemplarily, TH_SIZE1 has a value of 64, TH_W1 has a value of 64, and TH_H1 has a value of 64.

[0312] 4.3. ETMVPAvailable = sh_EtmvpEnableFlag && (width >= TH_W2) && (height >= TH_H2)

[0313] sh_EtmvpEnableFlag is the sequence-level switch of the ETMVP mode. When the sequence-level switch of the ETMVP mode is in the on state, sh_EtmvpEnableFlag has a value of 1; when the sequence-level switch of the ETMVP mode is in the off state, sh_EtmvpEnableFlag has a value of 0;

[0314] When the width of the current block is greater than or equal to TH_W2 (i.e., the above-mentioned second width threshold), (width >= TH_W2) has a value of 1; when the width of the current block is less than TH_W2, (width >= TH_W2) has a value of 0;

[0315] When the height of the current block is greater than or equal to TH_H2 (i.e., the above-mentioned second height threshold), (height >= TH_H2) has a value of 1; when the height of the current block is less than TH_H2, (height >= TH_H2) has a value of 0.

[0316] When the values of sh_EtmvpEnableFlag, (width >= TH_W2), and (height >= TH_H2) are all 1, that is, when the limiting conditions for enabling the ETMVP mode are met, ETMVPAvailable takes the value of 1 and the ETMVP mode is available;

[0317] When any one of the values of sh_EtmvpEnableFlag, (width >= TH_W2), and (height >= TH_H2) is 0, that is, when the limiting conditions for enabling the ETMVP mode are not met, ETMVPAvailable takes the value of 0 and the ETMVP mode is not available.

[0318] Exemplarily, TH_W2 takes the value of 8 and TH_H2 takes the value of 8.

[0319] 4.4. AffineAvailable = sh_AffineEnableFlag && (width >= TH_W3) && (height >= TH_H3)

[0320] sh_AffineEnableFlag is the sequence-level switch for the Affine mode. When the sequence-level switch of the Affine mode is in the on state, sh_AffineEnableFlag takes the value of 1; when the sequence-level switch of the Affine mode is in the off state, sh_AffineEnableFlag takes the value of 0;

[0321] When the width of the current block is greater than or equal to TH_W3 (i.e., the above-mentioned third width threshold), (width >= TH_W3) takes the value of 1; when the width of the current block is less than TH_W3, (width >= TH_W3) takes the value of 0;

[0322] When the height of the current block is greater than or equal to TH_H3 (i.e., the above-mentioned third height threshold), (height >= TH_H3) takes the value of 1; when the height of the current block is less than TH_H3, (height >= TH_H3) takes the value of 0.

[0323] When the values of sh_AffineEnableFlag, (width >= TH_W3), and (height >= TH_H3) are all 1, that is, when the limiting conditions for enabling the Affine mode are met, AffineAvailable takes the value of 1 and the Affine mode is available;

[0324] When any one of sh_AffineEnableFlag, (width >= TH_W3), and (height >= TH_H3) has a value of 0, that is, when the restrictive conditions for enabling the Affine mode are not met, AffineAvailable has a value of 0 and the Affine mode is not available.

[0325] Exemplarily, TH_W3 has a value of 16 and TH_H3 has a value of 16.

[0326] For Figure 5A the binary tree diagram shown, take the first value as 0 and the second value as 1 as an example.

[0327] When determining the value of umve_awp_etmvp_flag, at least one prediction mode can be a conventional Skip, Affine mode, UMVE mode, AWP mode, and ETMVP mode. Before decoding the encoded information of umve_awp_etmvp_flag (i.e., the bit to be decoded is umve_awp_etmvp_flag), some decoding information of the current block can be obtained, and based on the obtained decoding information and the restrictive conditions for enabling the above UMVE mode, AWP mode, and ETMVP mode, it can be determined whether the current block does not meet the restrictive conditions for enabling the UMVE mode, AWP mode, and ETMVP mode (i.e., meets the decoding-free condition of umve_awp_etmvp_flag). It can also be understood as obtaining some specific information of the current block to determine whether the UMVE mode, AWP mode, and ETMVP mode are available in the current block. If the UMVE mode, AWP mode, and ETMVP mode are not available in the current block, the step of decoding the encoded information of umve_awp_etmvp_flag is skipped, and it is directly deduced that the value of umve_awp_etmvp_flag is 0; if any one of the UMVE mode, AWP mode, and ETMVP mode is available, the encoded information of umve_awp_etmvp_flag is decoded to determine whether the value of umve_awp_etmvp_flag is 0 or 1.

[0328] If the value of umve_awp_etmvp_flag is 0, it is determined that the conventional skip mode or Affine mode needs to be enabled, and then the value of affine_flag needs to be determined.

[0329] When determining the value of affine_flag (i.e., the decoding mode is marked as affine_flag), at least one prediction mode is the regular skip mode and the Affine mode. Before decoding the encoded information of affine_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the Affine mode based on the obtained decoded information and the enabling restrictions allowed by the Affine mode; if so, skip the step of decoding the encoded information of affine_flag and directly derive that the value of affine_flag is 0; otherwise, decode the encoded information of affine_flag to determine whether the value of affine_flag is 0 or 1.

[0330] If the value of affine_flag is 0, it is determined that the current block enables the regular skip mode; if the value of affine_flag is 1, it is determined that the current block enables the Affine mode.

[0331] If the value of umve_awp_etmvp_flag is 1, it is necessary to further determine the value of etmvp_flag.

[0332] When determining the value of etmvp_flag, at least one prediction mode can be the UMVE mode, the AWP mode, and the ETMVP mode. Before decoding the encoded information of etmvp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the ETMVP mode based on the obtained decoded information and the enabling restrictions allowed by the ETMVP mode; if so, skip the step of decoding the encoded information of etmvp_flag and directly derive that the value of etmvp_flag is 0; otherwise, decode the encoded information of etmvp_flag to determine whether the value of etmvp_flag is 0 or 1.

[0333] If the value of etmvp_flag is 1, it is determined that the current block enables the ETMVP mode.

[0334] If the value of etmvp_flag is 0, it is determined that the current block enables the UMVE mode or the AWP mode. At this time, it is necessary to determine the value of awp_flag.

[0335] When determining the value of awp_flag, at least one prediction mode is the UMVE mode and the AWP mode. Before decoding the encoded information of awp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the AWP mode according to the obtained decoded information and the above-mentioned enabling restrictions allowed by the AWP mode; if so, skip the step of decoding the encoded information of awp_flag and directly deduce that the value of awp_flag is 0; otherwise, decode the encoded information of awp_flag to determine whether the value of awp_flag is 0 or 1.

[0336] If the value of awp_flag is 0, it is determined that the UMVE mode is enabled for the current block; if the value of awp_flag is 1, it is determined that the AWP mode is enabled for the current block.

[0337] Exemplarily, the syntax logic example of the above mode flag bit decoding is as follows:

[0338]

[0339] Based on the above syntax logic, when the skip_flag value is 1, if at least one of sh_UmveEnableFlag, sh_AwpEnableFlag && (width >= 8) && (height >= 8) && (width <= 64) && (height <= 64) && (PictureType == 2), and sh_EtmvpEnableFlag && (width >= 8) && (height >= 8) has a value of 1, that is, the current block meets the enabling restrictions of any one of the prediction modes of the UMVE mode, the AWP mode, and the ETMVP mode, then it is necessary to decode the encoded information of umve_awp_etmvp_flag.

[0340] Exemplarily, PictureType == 2 indicates that the frame type of the image frame to which the current block belongs is a B frame.

[0341] If umve_awp_etmvp_flag, sh_EtmvpEnableFlag && (width >= 8) && (height >= 8), sh_UmveEnableFlag || (sh_AwpEnableFlag && (width * height >= 64) && (width <= 64) && (height <= 64) && (PictureType == 2)) all have a value of 1, that is, the value of umve_awp_etmvp_flag is 1, and the current block meets the restricted conditions for enabling the ETMVP mode, and the current block meets the enabling conditions of either the UMVE mode or the AWP mode, then the encoded information of etmvp_flag needs to be decoded.

[0342] If umve_awp_etmvp_flag,!etmvp_flag, and (sh_UmveEnableFlag || (sh_AwpEnableFlag && (width >= 8) && (height >= 8) && (width <= 64) && (height <= 64) && (PictureType == 2)) all have a value of 1, that is, the value of umve_awp_etmvp_flag is 1, the value of etmvp_flag is 0, and the current block meets the restricted conditions for enabling either the UMVE mode or the AWP mode, then the encoded information of awp_flag needs to be decoded.

[0343] If!umve_awp_etmvp_flag and sh_AffineEnableFlag && (width >= 16) && (height >= 16) all have a value of 1, that is, the value of umve_awp_etmvp_flag is 0, and the current block meets the restricted conditions for enabling the Affine mode, then the encoded information of affine_flag needs to be decoded.

[0344] Exemplarily, in the above syntax logic, the content in the adjacent "if()" above each mode flag bit is the decoding condition for that mode flag bit. If the current block does not meet this condition, it can be determined that the current block meets the non-decoding condition for that mode flag bit.

[0345] Example 5

[0346] Assume that the mode flag bits for which the values are to be determined include umve_awp_etmvp_flag, affine_flag, umve_flag, awp_flag as an example. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 5.1:

[0347] Table 5.1

[0348]

[0349] Its corresponding binary tree diagram can be as Figure 5B shown

[0350] Exemplarily, for umve_awp_etmvp_flag, affine_flag, umve_flag, and awp_flag, when the conditions shown in Table 5.2 are met, it is necessary to decode the encoding information of the corresponding mode flag bits; otherwise, the process of decoding the encoding information of the corresponding mode flag bits can be skipped, and the value of the corresponding mode flag bits can be derived

[0351] Table 5.2

[0352]

[0353]

[0354] Exemplarily, the restrictive conditions for enabling each prediction mode can refer to the relevant descriptions in Embodiment 4

[0355] Exemplarily, the syntax logic for decoding the above mode flag bits can be similar to the implementation in Embodiment 4, and this application embodiment will not elaborate here

[0356] For Figure 5B the shown binary tree diagram, taking the first value as 0 and the second value as 1 as an example

[0357] When determining the value of umve_awp_etmvp_flag, at least one prediction mode can be the conventional Skip, Affine mode, UMVE mode, AWP mode, and ETMVP mode. Before decoding the encoded information of umve_awp_etmvp_flag, some decoded information of the current block can be obtained, and based on the obtained decoded information and the enabling restrictions allowed by the above UMVE mode, AWP mode, and ETMVP mode, it can be determined whether the current block does not meet the enabling restrictions allowed by the UMVE mode, AWP mode, and ETMVP mode. It can also be understood as obtaining some specific information of the current block to determine whether the UMVE mode, AWP mode, and ETMVP mode are available for the current block. If the UMVE mode, AWP mode, and ETMVP mode are all unavailable, the step of decoding the encoded information of umve_awp_etmvp_flag is skipped, and the value of umve_awp_etmvp_flag is directly deduced to be 0; if any one of the UMVE mode, AWP mode, and ETMVP mode is available, the encoded information of umve_awp_etmvp_flag is decoded to determine whether the value of umve_awp_etmvp_flag is 0 or 1.

[0358] If the value of umve_awp_etmvp_flag is 0, it is determined that the conventional skip mode or Affine mode needs to be enabled. Next, the value of affine_flag needs to be determined.

[0359] When determining the value of affine_flag, at least one prediction mode can be the conventional skip mode, Affine mode. Before decoding the encoded information of affine_flag, based on the obtained decoded information and the enabling restrictions allowed by the Affine mode, it can be determined whether the current block does not meet the enabling restrictions allowed by the Affine mode; if so, the step of decoding the encoded information of affine_flag is skipped, and the value of affine_flag is directly deduced to be 0; otherwise, the encoded information of affine_flag is decoded to determine whether the value of affine_flag is 0 or 1.

[0360] If the value of affine_flag is 0, it is determined that the current block enables the conventional skip mode; if the value of affine_flag is 1, it is determined that the current block enables the Affine mode.

[0361] If the value of umve_awp_etmvp_flag is 1, the value of umve_flag needs to be determined again.

[0362] When determining the value of umve_flag, at least one prediction mode can be the ETMVP mode, the AWP mode, and the UMVE mode. Before decoding the encoded information of umve_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the UMVE mode according to the obtained decoded information and the above-mentioned enabling restrictions allowed by the UMVE mode; if so, skip the step of decoding the encoded information of umve_flag and directly deduce that the value of umve_flag is 0; otherwise, decode the encoded information of umve_flag to determine whether the value of umve_flag is 0 or 1.

[0363] If the value of umve_flag is 1, it is determined that the current block enables the UMVE mode.

[0364] If the value of umve_flag is 0, it is determined that the current block enables the ETMVP mode or the AWP mode. At this time, it is necessary to determine the value of awp_flag.

[0365] When determining the value of awp_flag, at least one prediction mode is the ETMVP mode and the AWP mode. Before decoding the encoded information of awp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the AWP mode according to the obtained decoded information and the above-mentioned enabling restrictions allowed by the AWP mode; if so, skip the step of decoding the encoded information of awp_flag and directly deduce that the value of awp_flag is 0; otherwise, decode the encoded information of awp_flag to determine whether the value of awp_flag is 0 or 1.

[0366] If the value of awp_flag is 0, it is determined that the current block enables the ETMVP mode; if the value of awp_flag is 1, it is determined that the current block enables the AWP mode.

[0367] Embodiment VI

[0368] Assume that the mode flag bits for which the values are to be determined include regular_skip_flag, umve_flag, awp_flag, and affine_flag as an example. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 6.1:

[0369] Table 6.1

[0370]

[0371] Its corresponding binary tree diagram can be as Figure 5C shown.

[0372] Exemplarily, for umve_awp_etmvp_flag, affine_flag, etmvp_flag, and awp_flag, when the conditions shown in Table 6.2 are met, the encoded information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the encoded information of the corresponding mode flag bit can be skipped, and the value of the corresponding mode flag bit can be derived.

[0373] Exemplarily, the "meeting the conditions" described in Table 6.2 is the decoding condition of the corresponding mode flag bit. When this condition is not met, it can be said that the current block meets the decoding exemption condition of the corresponding mode flag bit.

[0374] Table 6.2

[0375]

[0376] Exemplarily, the limiting conditions for enabling each prediction mode can refer to the relevant descriptions in Embodiment 4.

[0377] Exemplarily, the syntax logic for decoding the above mode flag bits can be similar to the implementation in Embodiment 4, and details are not elaborated in this embodiment of the present application.

[0378] For Figure 5C the binary tree diagram shown, take the first value as 0 and the second value as 1 as an example.

[0379] When determining the value of regular_skip_flag, the mode flag bit to be decoded is regular_skip_flag, and the decoding condition of the mode flag bit to be decoded is "UMVEAvailable||AWPAvailable||ETMVPAvailable||AffineAvailable", that is, when any one of the UMVE mode, AWP mode, ETMVP mode, and Affine mode is available, it is determined that the current block meets the decoding condition of the mode flag bit to be decoded, that is, the current block does not meet the decoding exemption condition of the mode flag bit to be decoded; when none of the UMVE mode, AWP mode, ETMVP mode, and Affine mode is available, it is determined that the current block does not meet the decoding condition of the mode flag bit to be decoded, that is, the current block meets the decoding exemption condition of the mode flag bit to be decoded.

[0380] Before decoding the coding information of regular_skip_flag, the decoding information can be obtained. According to the obtained decoding information and the above-mentioned restricted conditions allowed to be enabled for the UMVE mode, AWP mode, ETMVP mode, and Affine mode, it is determined whether the current block meets the decoding conditions of the mode flag bit to be decoded. If the decoding conditions are met (that is, the conditions for skipping decoding are not met, the same below), the binary coding information of regular_skip_flag is decoded to determine the value of regular_skip_flag; if the decoding conditions are not met (that is, the conditions for skipping decoding are met, the same below), the step of decoding the coding information of regular_skip_flag is skipped, and the value of regular_skip_flag is determined to be 1.

[0381] If the value of regular_skip_flag is 0, the value of umve_flag needs to be determined.

[0382] When determining the value of umve_flag, the mode flag bit to be decoded is umve_flag, and the decoding condition of the mode flag bit to be decoded is "regular_skip_flag is 0 && UMVEAvailable && (AWPAvailable || ETMVPAvailable || AffineAvailable)", that is, if the value of umve_flag is 0, the UMVE mode is available, and any one of the AWP mode, ETMVP mode, and Affine mode is available, it is determined that the decoding conditions of umve_flag are met, and the coding information of umve_flag needs to be decoded; otherwise, it is determined that the decoding conditions of umve_flag are not met.

[0383] Before decoding the coding information of umve_flag, according to the obtained decoding information and the above-mentioned restricted conditions allowed to be enabled for the AWP mode, ETMVP mode, and Affine mode, it can be determined whether the current block meets the decoding conditions of the mode flag bit to be decoded. If the decoding conditions are met, the coding information of umve_flag is decoded to determine the value of umve_flag; if the decoding conditions are not met, the step of decoding the coding information of umve_flag is skipped, and the value of umve_flag is directly deduced to be 1.

[0384] If the value of umve_flag is 0, the value of awp_flag needs to be determined.

[0385] When determining the value of awp_flag, the decoding mode flag bit is awp_flag, and the decoding condition for the decoding mode flag bit is "regular_skip_flag is 0 && umve_flag is 0 && AWPAvailable && (ETMVPAvailable || AffineAvailable)", that is, if the value of regular_skip_flag is 0, the value of umve_flag is 0, the AWP mode is available, and either the ETMVP mode or the Affine mode is available, then it is determined that the decoding condition for the decoding mode flag bit is satisfied; otherwise, it is determined that the decoding condition for the decoding mode flag bit is not satisfied.

[0386] Before decoding the encoding of awp_flag, based on the obtained decoding information and the above-mentioned enabling restriction conditions for the AWP mode, ETMVP mode, and Affine mode, it can be determined whether the current block satisfies the decoding condition for the decoding mode flag bit. If the decoding condition is satisfied, the encoding information of awp_flag is decoded to determine the value of awp_flag; if the decoding condition is not satisfied, the step of decoding the encoding information of awp_flag is skipped, and the value of awp_flag is directly derived as 1.

[0387] If the value of awp_flag is 0, then it is necessary to determine the value of affine_flag.

[0388] When determining the value of affine_flag, the decoding mode flag bit is affine_flag, and the decoding condition for the decoding mode flag bit is "regular_skip_flag is 0 && umve_flag is 0 && awp_flag is 0 && ETMVPAvailable && AffineAvailable", that is, if the value of regular_skip_flag is 0, the value of umve_flag is 0, the value of awp_flag is 0, the ETMVP mode is available, and the Affine mode is available, then it is determined that the decoding condition for the decoding mode flag bit is satisfied; otherwise, it is determined that the decoding condition for the decoding mode flag bit is not satisfied.

[0389] Before decoding the encoding of affine_flag, based on the obtained decoding information, as well as the above-mentioned ETMVP mode and the enabling restriction conditions allowed by the Affine mode, it can be determined whether the current block meets the decoding conditions for the mode flag bit to be decoded. If the decoding conditions are met, the encoding information of affine_flag is decoded to determine the value of affine_flag; if the decoding conditions are not met, the step of decoding the encoding information of affine_flag is skipped, and the value of affine_flag is determined to be 0 or 1 according to the availability of the Affine mode.

[0390] Exemplarily, if the Affine mode is available, determine that the value of affine_flag is 1; otherwise, if the Affine mode is not available, determine that the value of affine_flag is 0.

[0391] Embodiment Seven

[0392] Taking the mode flag bits whose values are to be determined including regular_skip_flag, umve_flag, affine_flag, and awp_flag as examples, the corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 7.1:

[0393] Table 7.1

[0394]

[0395] Its corresponding binary tree diagram can be as Figure 5D shown.

[0396] Exemplarily, for regular_skip_flag, umve_flag, affine_flag, and awp_flag, when the conditions shown in Table 7.2 are met, the encoding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the encoding information of the corresponding mode flag bit can be skipped, and the value of the corresponding mode flag bit is derived.

[0397] Exemplarily, the "meeting the conditions" described in Table 7.2 is the decoding condition for the corresponding mode flag bit. When this condition is not met, it can be said that the current block meets the decoding-free condition for the corresponding mode flag bit.

[0398] Table 7.2

[0399]

[0400] Exemplarily, the enabling restriction conditions allowed by each prediction mode can refer to the relevant descriptions in Embodiment Four.

[0401] Exemplarily, the syntax logic for decoding the above pattern flag bits can be similar to the implementation in Embodiment 4, and details are not described herein in the embodiments of the present application.

[0402] For Figure 5D the binary tree diagram shown, take the first value as 0 and the second value as 1 as an example.

[0403] When determining the value of regular_skip_flag, the pattern flag bit to be decoded is regular_skip_flag, and the decoding condition for the pattern flag bit to be decoded is "UMVEAvailable||AWPAvailable||ETMVPAvailable||AffineAvailable", that is, when any one of the UMVE mode, AWP mode, ETMVP mode, and Affine mode is available, it is determined that the current block meets the decoding condition of the pattern flag bit to be decoded, that is, the current block does not meet the decoding-free condition of the pattern flag bit to be decoded; when the UMVE mode, AWP mode, ETMVP mode, and Affine mode are all unavailable, it is determined that the current block does not meet the decoding condition of the pattern flag bit to be decoded, that is, the current block meets the decoding-free condition of the pattern flag bit to be decoded.

[0404] Before decoding the coding information of regular_skip_flag, the decoding information can be obtained. According to the obtained decoding information and the above-mentioned enabling restriction conditions allowed by the UMVE mode, AWP mode, ETMVP mode, and Affine mode, it is determined whether the current block meets the decoding condition of the pattern flag bit to be decoded. If the decoding condition is met (that is, the decoding-free condition is not met, the same below), the binary coding information of regular_skip_flag is decoded to determine the value of regular_skip_flag; if the decoding condition is not met (that is, the decoding-free condition is met, the same below), the step of decoding the coding information of regular_skip_flag is skipped, and the value of regular_skip_flag is directly deduced to be 1.

[0405] If the value of regular_skip_flag is 0, then the value of umve_flag needs to be determined.

[0406] When determining the value of umve_flag, the mode flag to be decoded is umve_flag, and the decoding condition for the mode flag to be decoded is "regular_skip_flag is 0 && UMVEAvailable && (AWPAvailable || ETMVPAvailable || AffineAvailable)". That is, if the value of umve_flag is 0, the UMVE mode is available, and any one of the AWP mode, ETMVP mode, and Affine mode is available, then it is determined that the decoding condition for umve_flag is satisfied, and the encoded information of umve_flag needs to be decoded; otherwise, it is determined that the decoding condition for umve_flag is not satisfied.

[0407] Before decoding the encoded information of umve_flag, it is possible to determine whether the current block satisfies the decoding condition of the mode flag to be decoded according to the obtained decoding information and the above-mentioned enabling restriction conditions of the AWP mode, ETMVP mode, and Affine mode. If the decoding condition is satisfied, the encoded information of umve_flag is decoded to determine the value of umve_flag; if the decoding condition is not satisfied, the step of decoding the encoded information of umve_flag is skipped, and the value of umve_flag is directly deduced to be 1.

[0408] If the value of umve_flag is 0, then it is necessary to determine the value of affine_flag.

[0409] When determining the value of awp_flag, the mode flag to be decoded is affine_flag, and the decoding condition for the mode flag to be decoded is "regular_skip_flag is 0 && umve_flag is 0 && AffineAvailable && (ETMVPAvailable || AWPAvailable)", that is, if the value of regular_skip_flag is 0, the value of umve_flag is 0, the Affine mode is available, and any one of the ETMVP mode and the AWP mode is available, then it is determined that the decoding condition for the mode flag to be decoded is satisfied; otherwise, it is determined that the decoding condition for the mode flag to be decoded is not satisfied.

[0410] Before decoding the coding of affine_flag, according to the obtained decoding information and the above-mentioned enabling limit conditions allowed by the ETMVP mode, AWP mode, and Affine mode, it can be determined whether the current block meets the decoding conditions of the mode flag bit to be decoded. If the decoding conditions are met, the coding information of affine_flag is decoded to determine the value of affine_flag; if the decoding conditions are not met, the step of decoding the coding information of affine_flag is skipped, and the value of affine_flag is directly derived as 1.

[0411] If the value of affine_flag is 0, it is necessary to determine the value of awp_flag.

[0412] When determining the value of awp_flag, the mode flag bit to be decoded is awp_flag, and the decoding conditions of the mode flag bit to be decoded are "regular_skip_flag is 0 && umve_flag is 0 && affine_flag is 0 && ETMVPAvailable && AWPAvailable", that is, if the value of regular_skip_flag is 0, the value of umve_flag is 0, the value of affine_flag is 0, the ETMVP mode is available, and the AWP mode is available, it is determined that the decoding conditions of the mode flag bit to be decoded are met; otherwise, it is determined that the decoding conditions of the mode flag bit to be decoded are not met.

[0413] Before decoding the coding of awp_flag, according to the obtained decoding information and the above-mentioned enabling limit conditions allowed by the ETMVP mode and AWP mode, it can be determined whether the current block meets the decoding conditions of the mode flag bit to be decoded. If the decoding conditions are met, the coding information of awp_flag is decoded to determine the value of awp_flag; if the decoding conditions are not met, the step of decoding the coding information of awp_flag is skipped, and the value of awp_flag is determined to be 0 or 1 according to the availability of the Affine mode.

[0414] Exemplarily, if the AWP mode is available, the value of awp_flag is determined to be 1; otherwise, if the AWP mode is not available, the value of awp_flag is determined to be 0.

[0415] The following describes the prediction mode decoding process in the case where the value of skip_flag is 0 in combination with an embodiment.

[0416] Embodiment VIII

[0417] When the skip_flag is 0, it is necessary to determine whether the current prediction mode is the direct mode according to the value of the mode flag bit (direct_flag) in the direct mode.

[0418] Decoding process of direct_flag:

[0419] Method 8.1,

[0420] If the current block uses ordinary intra prediction or block copy intra prediction or string copy intra prediction (i.e., satisfies the direct mode disabling condition), there is no need to decode the encoded information of direct_flag, and it is determined that the value of direct_flag is equal to 0 (i.e., the first value above).

[0421] Method 8.2,

[0422] If the current block uses ordinary intra prediction or block copy intra prediction or string copy intra prediction, or, the width plus height of the current block is less than the threshold WH2 (i.e., the second threshold above) (i.e., satisfies the direct mode disabling condition), there is no need to decode the encoded information of direct_flag, and it is determined that the value of direct_flag is equal to 0 (i.e., the first value above).

[0423] Otherwise, decode the encoded information of direct_flag to determine the value of direct_flag.

[0424] Exemplarily, WH2 is 16 in Method 8.2.

[0425] Exemplarily, a direct_flag value of 1 means that the current coding unit directly reuses the motion information of adjacent blocks without needing to parse the detailed motion vector difference information.

[0426] The following describes the prediction mode decoding process for the case where the value of direct_flag is 1 (InterPF mode is allowed to be enabled) in combination with embodiments.

[0427] Embodiment Nine

[0428] Assume that the mode flag bits to be determined include umve_awp_etmvp_flag, interpf_flag, affine_flag, etmvp_flag, awp_flag as examples, and the corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 9.1:

[0429] Table 9.1

[0430]

[0431] Its corresponding binary tree diagram can be as Figure 5E shown.

[0432] Exemplarily, for umve_awp_etmvp_flag, interpf_flag, affine_flag, etmvp_flag, awp_flag, when the conditions shown in Table 9.2 are met, the encoded information of the corresponding mode flag bits needs to be decoded; otherwise, the process of decoding the encoded information of the corresponding mode flag bits can be skipped, and the value of the corresponding mode flag bits can be derived.

[0433] Table 9.2

[0434]

[0435] Exemplarily, the enabling limit conditions for the conventional direct mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode can be referred to the relevant descriptions in Embodiment 4.

[0436] The enabling limit conditions for the InterPF mode are as follows:

[0437] InterPFAvailable = sh_InterpfEnableFlag && (width * height >= TH_SIZE2) && (width <= TH_W4) && (height <= TH_H4)

[0438] sh_InterpfEnableFlag is the sequence-level switch of the InterPF mode. When the sequence-level switch of the InterPF mode is in the on state, sh_InterpfEnableFlag has a value of 1; when the sequence-level switch of the InterPF mode is in the off state, sh_InterpfEnableFlag has a value of 0;

[0439] When the product of the width and height of the current block is greater than or equal to TH_SIZE2 (i.e., the second size threshold above), (width * height >= TH_SIZE2) has a value of 1; when the product of the width and height of the current block is less than TH_SIZE2, (width * height >= TH_SIZE2) has a value of 0;

[0440] When the width of the current block is less than or equal to TH_W4 (i.e., the fourth width threshold above), (width <= TH_W4) has a value of 1; when the width of the current block is greater than TH_W4, (width <= TH_W4) has a value of 0;

[0441] When the height of the current block is less than or equal to TH_H4 (i.e., the above-mentioned fourth height threshold), the value of (height <= TH_H4) is 1; when the height of the current block is greater than TH_H4, the value of (height <= TH_H4) is 0.

[0442] When sh_InterpfEnableFlag, (width * height >= TH_SIZE2), (width <= TH_W4), and (height <= TH_H4) all have a value of 1, that is, when the restricted conditions for enabling the InterPF mode are met, InterPFAvailable has a value of 1 and the InterPF mode is available;

[0443] When any one of sh_InterpfEnableFlag, (width * height >= TH_SIZE2), (width <= TH_W4), and (height <= TH_H4) has a value of 0, that is, when the restricted conditions for enabling the InterPF mode are not met, InterPFAvailable has a value of 0 and the InterPF mode is not available.

[0444] Exemplarily, TH_SIZE2 has a value of 64, TH_W4 has a value of 64, and TH_H4 has a value of 64.

[0445] Exemplarily, the syntax logic example of the above mode flag bit decoding is as follows:

[0446]

[0447]

[0448] Based on the above syntax logic, when the direct_flag value is 1, if at least one of sh_UmveEnableFlag, sh_AwpEnableFlag && (width >= 8) && (height >= 8) && (width <= 64) && (height <= 64) && (PictureType == 2), and sh_EtmvpEnableFlag && (width >= 8) && (height >= 8) has a value of 1, that is, when the current block meets the restricted conditions for enabling any one of the UMVE mode, AWP mode, and ETMVP mode prediction modes, the encoded information of umve_awp_etmvp_flag needs to be decoded.

[0449] If umve_awp_etmvp_flag, sh_EtmvpEnableFlag && (width >= 8) && (height >= 8), sh_UmveEnableFlag || (sh_AwpEnableFlag && (width * height >= 64 && (width <= 64) && (height <= 64) && (PictureType == 2)) all have a value of 1, that is, the value of umve_awp_etmvp_flag is 1, and the current block meets the restricted conditions for enabling the ETMVP mode, and the current block meets the enabling conditions of either the UMVE mode or the AWP mode, then the encoded information of etmvp_flag needs to be decoded.

[0450] If umve_awp_etmvp_flag,!etmvp_flag, and sh_UmveEnableFlag || (sh_AwpEnableFlag && (width * height >= 64) && (width <= 64) && (height <= 64)) && (PictureType == 2)) all have a value of 1, that is, the value of umve_awp_etmvp_flag is 1, the value of etmvp_flag is 0, and the current block meets the restricted conditions for enabling either the UMVE mode or the AWP prediction mode, then the encoded information of awp_flag needs to be decoded.

[0451] If!umve_awp_etmvp_flag and sh_AffineEnableFlag && (width >= 16) && (height >= 16) both have a value of 1, that is, the value of umve_awp_etmvp_flag is 0, and the current block meets the restricted conditions for enabling the Affine mode, then the encoded information of affine_flag needs to be decoded.

[0452] If!umve_awp_etmvp_flag,!affine_flag, and sh_InterpfEnableFlag && (width * height >= 64) && (width <= 64) && (height <= 64) all have a value of 1, that is, the value of umve_awp_etmvp_flag is 0, the value of affine_flag is 0, and the current block meets the enabling conditions of the InterPF mode, then interpf_flag needs to be decoded.

[0453] For Figure 5EThe binary tree diagram shown takes the first value as 0 and the second value as 1 as an example.

[0454] When determining the value of umve_awp_etmvp_flag, at least one prediction mode can be the conventional direct mode, InterPF mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode. Before decoding the coding information of umve_awp_etmvp_flag, some decoding information of the current block can be obtained, and based on the obtained decoding information and the enabling restriction conditions allowed by the above UMVE mode, AWP mode, and ETMVP mode, it is determined whether the current block does not meet the enabling restriction conditions of the UMVE mode, AWP mode, and ETMVP mode. If the UMVE mode, AWP mode, and ETMVP are all unavailable, the step of decoding the coding information of umve_awp_etmvp_flag is skipped, and it is directly deduced that the value of umve_awp_etmvp_flag is 0; if any one of the UMVE mode, AWP mode, and ETMVP mode is available, the coding information of umve_awp_etmvp_flag is decoded to determine whether the value of umve_awp_etmvp_flag is 0 or 1.

[0455] If the value of umve_awp_etmvp_flag is 0, it is determined that the conventional direct mode, InterPF mode, or Affine mode needs to be enabled. At this time, the value of affine_flag needs to be determined again.

[0456] When determining the value of affine_flag, at least one prediction mode can be the conventional direct mode, or InterPF mode, Affine mode. Before decoding the coding information of affine_flag, based on the obtained decoding information and the enabling restriction conditions allowed by the Affine mode, it is determined whether the current block does not meet the enabling restriction conditions of the Affine mode; if so, the step of decoding the coding information of affine_flag is skipped, and it is directly deduced that the value of affine_flag is 0; otherwise, the coding information of affine_flag is decoded to determine whether the value of affine_flag is 0 or 1.

[0457] If the value of affine_flag is 0, it is determined that the conventional direct mode or InterPF mode is enabled for the current block. At this time, the value of interpf_flag needs to be determined again; if the value of affine_flag is 1, it is determined that the Affine mode is enabled for the current block.

[0458] When determining the value of interpf_flag, at least one prediction mode is the conventional direct mode and the InterPF mode. Before decoding the coded information of interpf_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the InterPF mode according to the obtained decoded information and the above-mentioned enabling restrictions allowed by the InterPF mode. If so, skip the step of decoding the coded information of interpf_flag and directly deduce that the value of interpf_flag is 0; otherwise, decode the coded information of interpf_flag to determine whether the value of interpf_flag is 0 or 1.

[0459] If the value of interpf_flag is 0, it is determined that the current block enables the conventional direct mode; if the value of interpf_flag is 1, it is determined that the current block enables the InterPF mode.

[0460] If the value of umve_awp_etmvp_flag is 1, it is necessary to further determine the value of etmvp_flag.

[0461] When determining the value of etmvp_flag, at least one prediction mode can be the UMVE mode, the AWP mode, and the ETMVP mode. Before decoding the coded information of etmvp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the ETMVP mode according to the obtained decoded information and the above-mentioned enabling restrictions allowed by the ETMVP mode; if so, skip the step of decoding the coded information of etmvp_flag and directly deduce that the value of etmvp_flag is 0; otherwise, decode the coded information of etmvp_flag to determine whether the value of etmvp_flag is 0 or 1.

[0462] If the value of etmvp_flag is 1, it is determined that the current block enables the ETMVP mode.

[0463] If the value of etmvp_flag is 0, it is determined that the current block enables the UMVE mode or the AWP mode. At this time, it is necessary to determine the value of awp_flag.

[0464] When determining the value of awp_flag, at least one prediction mode is the UMVE mode and the AWP mode. Before decoding the coding information of awp_flag, it is possible to determine whether the current block does not meet the enabling restriction conditions of the AWP mode according to the obtained decoding information and the above-mentioned enabling restriction conditions of the AWP mode; if so, skip the step of decoding the coding information of awp_flag and directly deduce that the value of awp_flag is 0; otherwise, decode the coding information of awp_flag to determine whether the value of awp_flag is 0 or 1.

[0465] If the value of awp_flag is 0, it is determined that the UMVE mode is enabled for the current block; if the value of awp_flag is 1, it is determined that the AWP mode is enabled for the current block.

[0466] Embodiment Ten

[0467] Assume that the mode flag bits for which the values are to be determined include umve_awp_etmvp_flag, interpf_flag, affine_flag, umve_flag, awp_flag as examples. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 10.1:

[0468] Table 10.1

[0469]

[0470] Its corresponding binary tree diagram can be as Figure 5F shown.

[0471] Exemplarily, for umve_awp_etmvp_flag, interpf_flag, affine_flag, umve_flag, awp_flag, when the conditions shown in Table 10.2 are met, it is necessary to decode the coding information of the corresponding mode flag bit; otherwise, the process of decoding the coding information of the corresponding mode flag bit can be skipped and the value of the corresponding mode flag bit can be deduced.

[0472] Table 10.2

[0473]

[0474] Exemplarily, the enabling restriction conditions of the conventional direct mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode can refer to the relevant descriptions in Embodiment Four.

[0475] The enabling restriction conditions of the InterPF mode can refer to the relevant descriptions in Embodiment Nine.

[0476] Exemplarily, the syntax logic for decoding the above pattern flag bits may be similar to the implementation in Embodiment 9, and details are not described herein in this embodiment of the present application.

[0477] For Figure 5F the binary tree diagram shown, take the first value as 0 and the second value as 1 as an example.

[0478] When determining the value of umve_awp_etmvp_flag, at least one prediction mode may be a conventional direct mode, an InterPF mode, an Affine mode, a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the encoded information of umve_awp_etmvp_flag, some decoded information of the current block can be obtained, and based on the obtained decoded information and the enabling restriction conditions allowed by the above UMVE mode, AWP mode, and ETMVP mode, it is determined whether the current block does not meet the enabling restriction conditions of the UMVE mode, AWP mode, and ETMVP mode. If the UMVE mode, AWP mode, and ETMVP mode are all unavailable, the step of decoding the encoded information of umve_awp_etmvp_flag is skipped, and it is directly deduced that the value of umve_awp_etmvp_flag is 0; if any one of the UMVE mode, AWP mode, and ETMVP mode is available, the encoded information of umve_awp_etmvp_flag is decoded to determine whether the value of umve_awp_etmvp_flag is 0 or 1.

[0479] If the value of umve_awp_etmvp_flag is 0, it is determined that the conventional direct mode, InterPF mode, or Affine mode needs to be enabled. At this time, the value of affine_flag needs to be determined.

[0480] When determining the value of affine_flag, at least one prediction mode may be a conventional direct mode, an InterPF mode, and an Affine mode. Before decoding the encoded information of affine_flag, based on the obtained decoded information and the enabling restriction conditions allowed by the Affine mode, it is determined whether the current block does not meet the enabling restriction conditions of the Affine mode; if so, the step of decoding the encoded information of affine_flag is skipped, and it is directly deduced that the value of affine_flag is 0; otherwise, the encoded information of affine_flag is decoded to determine whether the value of affine_flag is 0 or 1.

[0481] If the value of affine_flag is 0, it is determined that the current block enables the normal direct mode or the InterPF mode. At this time, it is necessary to further determine the value of interpf_flag; if the value of affine_flag is 1, it is determined that the current block enables the Affine mode.

[0482] When determining the value of interpf_flag, at least one prediction mode is the normal direct mode and the InterPF mode. Before decoding the encoded information of interpf_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the InterPF mode according to the obtained decoded information and the above-mentioned enabling restrictions of the InterPF mode. If so, skip the step of decoding the encoded information of interpf_flag and directly deduce that the value of interpf_flag is 0; otherwise, decode the encoded information of interpf_flag to determine whether the value of interpf_flag is 0 or 1.

[0483] If the value of interpf_flag is 0, it is determined that the current block enables the normal direct mode; if the value of interpf_flag is 1, it is determined that the current block enables the InterPF mode.

[0484] If the value of umve_awp_etmvp_flag is 1, it is necessary to further determine the value of umve_flag.

[0485] When determining the value of umve_flag, at least one prediction mode can be the ETMVP mode, the AWP mode, and the UVME mode. Before decoding the encoded information of umve_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the UMVE mode according to the obtained decoded information and the above-mentioned enabling restrictions of the UMVE mode; if so, skip the step of decoding the encoded information of umve_flag and directly deduce that the value of umve_flag is 0; otherwise, decode the encoded information of umve_flag to determine whether the value of umve_flag is 0 or 1.

[0486] If the value of umve_flag is 1, it is determined that the current block enables the UMVE mode.

[0487] If the value of umve_flag is 0, it is determined that the current block enables the ETMVP mode or the AWP mode. At this time, it is necessary to determine the value of awp_flag.

[0488] When determining the value of awp_flag, at least one prediction mode is the ETMVP mode and the AWP mode. Before decoding the encoded information of awp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the AWP mode according to the obtained decoded information and the above-mentioned enabling restrictions allowed by the AWP mode; if so, skip the step of decoding the encoded information of awp_flag and directly deduce that the value of awp_flag is 0; otherwise, decode the encoded information of awp_flag to determine whether the value of awp_flag is 0 or 1.

[0489] If the value of awp_flag is 0, it is determined that the current block enables the ETMVP mode; if the value of awp_flag is 1, it is determined that the current block enables the AWP mode.

[0490] Embodiment XI

[0491] Assume that the mode flag bits for which the values are to be determined include umve_awp_etmvp_flag, affine_flag, etmvp_interpf_flag, awp_flag, and interpf_flag as examples. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 11.1:

[0492] Table 11.1

[0493]

[0494] Its corresponding binary tree diagram can be as Figure 5G shown.

[0495] Exemplarily, for umve_awp_etmvp_flag, affine_flag, etmvp_interpf_flag, awp_flag, and interpf_flag, when the conditions shown in Table 11.2 are met, it is necessary to decode the encoded information of the corresponding mode flag bit; otherwise, the process of decoding the encoded information of the corresponding mode flag bit can be skipped and the value of the corresponding mode flag bit can be deduced.

[0496] Table 11.2

[0497]

[0498]

[0499] Exemplarily, the enabling restrictions allowed by the conventional direct mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode can refer to the relevant descriptions in Embodiment IV.

[0500] The restricted conditions that allow the InterPF mode to be enabled can be referred to the relevant descriptions in Embodiment IX.

[0501] Exemplarily, the syntax logic for decoding the above mode flag bits can be similar to the implementation in Embodiment IX, and will not be elaborated herein in the embodiments of the present application.

[0502] For Figure 5G the shown binary tree diagram, take the first value as 0 and the second value as 1 as an example.

[0503] When determining the value of umve_awp_etmvp_flag, at least one prediction mode can be the conventional direct mode, Affine mode, UMVE mode, AWP mode, ETMVP mode, and InterPF mode. Before decoding the encoded information of umve_awp_etmvp_flag, some decoded information of the current block can be obtained, and based on the obtained decoded information and the restricted conditions that allow the UMVE mode, AWP mode, ETMVP mode, and InterPF mode to be enabled, it is determined whether the current block does not meet the restricted conditions that allow the UMVE mode, AWP mode, ETMVP mode, and InterPF mode to be enabled. If the UMVE mode, AWP mode, ETMVP mode, and InterPF mode are all unavailable, the step of decoding the encoded information of umve_awp_etmvp_flag is skipped, and it is directly deduced that the value of umve_awp_etmvp_flag is 0; if any of the prediction modes in the UMVE mode, AWP mode, ETMVP mode, and InterPF mode is available, the encoded information of umve_awp_etmvp_flag is decoded to determine whether the value of umve_awp_etmvp_flag is 0 or 1.

[0504] If the value of umve_awp_etmvp_flag is 0, it is determined that the conventional direct mode or Affine mode needs to be enabled. At this time, the value of affine_flag needs to be determined again.

[0505] When determining the value of affine_flag, at least one prediction mode can be the conventional direct mode and the Affine mode. Before decoding the encoded information of affine_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the Affine mode based on the obtained decoded information and the enabling restrictions allowed by the Affine mode; if so, skip the step of decoding the encoded information of affine_flag and directly deduce that the value of affine_flag is 0; otherwise, decode the encoded information of affine_flag to determine whether the value of affine_flag is 0 or 1.

[0506] If the value of affine_flag is 0, it is determined that the current block enables the conventional direct mode; if the value of affine_flag is 1, it is determined that the current block enables the Affine mode.

[0507] If the value of umve_awp_etmvp_flag is 1, it is necessary to further determine the value of etmvp_interpf_flag.

[0508] When determining the value of etmvp_interpf_flag, at least one prediction mode can be the UMVE mode, the AWP mode, the ETMVP mode, and the InterPF mode. Before decoding the encoded information of etmvp_interpf_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the ETMVP mode and the InterPF mode based on the obtained decoded information and the enabling restrictions allowed by the ETMVP mode and the InterPF mode; if so, skip the step of decoding the encoded information of etmvp_interpf_flag and directly deduce that the value of etmvp_interpf_flag is 0; otherwise, decode the encoded information of etmvp_interpf_flag to determine whether the value of etmvp_interpf_flag is 0 or 1.

[0509] If the value of etmvp_interpf_flag is 0, it is determined that the current block enables the UMVE mode or the AWP mode. At this time, it is necessary to determine the value of awp_flag.

[0510] When determining the value of awp_flag, at least one prediction mode is the UMVE mode and the AWP mode. Before decoding the coded information of awp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the AWP mode according to the obtained decoded information and the above-mentioned enabling restrictions of the AWP mode; if so, skip the step of decoding the coded information of awp_flag and directly infer that the value of awp_flag is 0; otherwise, decode the coded information of awp_flag to determine whether the value of awp_flag is 0 or 1.

[0511] If the value of awp_flag is 0, it is determined that the current block enables the UMVE mode; if the value of awp_flag is 1, it is determined that the current block enables the AWP mode.

[0512] If the value of etmvp_interpf_flag is 1, it is determined that the current block enables the ETMVP mode or the InterPF mode. At this time, it is necessary to determine the value of interpf_flag.

[0513] When determining the value of interpf_flag, at least one prediction mode is the ETMVP mode and the InterPF mode. Before decoding the coded information of interpf_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the InterPF mode according to the obtained decoded information and the above-mentioned enabling restrictions of the InterPF mode; if so, skip the step of decoding the coded information of interpf_flag and directly infer that the value of interpf_flag is 0; otherwise, decode the coded information of interpf_flag to determine whether the value of interpf_flag is 0 or 1.

[0514] If the value of interpf_flag is 0, it is determined that the current block enables the ETMVP mode; if the value of interpf_flag is 1, it is determined that the current block enables the InterPF mode.

[0515] Embodiment Twelve

[0516] Assume that the mode flag bits for which the values are to be determined include umve_awp_awp_flag, affine_flag, umve_interpf_flag, awp_flag, interpf_flag as examples. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 12.1:

[0517] Table 12.1

[0518]

[0519]

[0520] Its corresponding binary tree diagram can be as follows Figure 5H shown.

[0521] Exemplarily, for umve_awp_awp_flag, affine_flag, umve_interpf_flag, awp_flag, and interpf_flag, when the conditions shown in Table 12.2 are met, the encoded information of the corresponding mode flag bits needs to be decoded; otherwise, the process of decoding the encoded information of the corresponding mode flag bits can be skipped, and the value of the corresponding mode flag bits can be derived.

[0522] Table 12.2

[0523]

[0524] Exemplarily, the enabling restriction conditions for the conventional direct mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode can refer to the relevant descriptions in Embodiment 4.

[0525] The enabling restriction conditions for the InterPF mode can refer to the relevant descriptions in Embodiment 9.

[0526] Exemplarily, the syntax logic for decoding the above mode flag bits can be similar to the implementation in Embodiment 9, and details are not described herein in this embodiment of the present application.

[0527] For Figure 5H the shown binary tree diagram, take the first value as 0 and the second value as 1 as an example.

[0528] When determining the value of umve_awp_etmvp_flag, at least one prediction mode can be the regular direct mode, Affine mode, ETMVP mode, AWP mode, UMVE mode, and InterPF mode. Before decoding the coding information of umve_awp_etmvp_flag, some decoding information of the current block can be obtained, and according to the obtained decoding information and the enabling restrictions allowed by the above ETMVP mode, AWP mode, UMVE mode, and InterPF mode, it is determined whether the current block does not meet the enabling restrictions allowed by the ETMVP mode, AWP mode, UMVE mode, and InterPF mode. If so, the step of decoding the coding information of umve_awp_etmvp_flag is skipped, and the value of umve_awp_etmvp_flag is directly derived as 0; if any of the prediction modes in the ETMVP mode, AWP mode, UMVE mode, and InterPF mode is available, the coding information of umve_awp_etmvp_flag is decoded to determine whether the value of umve_awp_etmvp_flag is 0 or 1.

[0529] If the value of umve_awp_etmvp_flag is 0, it is determined that the regular direct mode or Affine mode needs to be enabled. At this time, the value of affine_flag needs to be determined again.

[0530] When determining the value of affine_flag, at least one prediction mode is the regular direct mode and Affine mode. Before decoding the coding information of affine_flag, according to the obtained decoding information and the enabling restrictions allowed by the Affine mode, it is determined whether the current block does not meet the enabling restrictions allowed by the Affine mode; if so, the step of decoding the coding information of affine_flag is skipped, and the value of affine_flag is directly derived as 0; otherwise, the coding information of affine_flag is decoded to determine whether the value of affine_flag is 0 or 1.

[0531] If the value of affine_flag is 0, it is determined that the regular direct mode is enabled for the current block; if the value of affine_flag is 1, it is determined that the Affine mode is enabled for the current block.

[0532] If the value of umve_awp_etmvp_flag is 1, the value of umve_interpf_flag needs to be determined again.

[0533] When determining the value of umve_interpf_flag, at least one prediction mode can be the ETMVP mode, AWP mode, UMVE mode, and InterPF mode. Before decoding the encoded information of umve_interpf_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the UMVE mode and InterPF mode according to the obtained decoded information and the enabling restrictions allowed by the above UMVE mode and InterPF mode; if so, skip the step of decoding the encoded information of umve_interpf_flag and directly infer that the value of umve_interpf_flag is 0; otherwise, decode the encoded information of umve_interpf_flag to determine whether the value of umve_interpf_flag is 0 or 1.

[0534] If the value of umve_interpf_flag is 0, it is determined that the current block enables the ETMVP mode or AWP mode. At this time, it is necessary to determine the value of awp_flag.

[0535] When determining the value of awp_flag, at least one prediction mode is the ETMVP mode and AWP mode. Before decoding the encoded information of awp_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the AWP mode according to the obtained decoded information and the enabling restrictions allowed by the above AWP mode; if so, skip the step of decoding the encoded information of awp_flag and directly infer that the value of awp_flag is 0; otherwise, decode the encoded information of awp_flag to determine whether the value of awp_flag is 0 or 1.

[0536] If the value of awp_flag is 0, it is determined that the current block enables the ETMVP mode; if the value of awp_flag is 1, it is determined that the current block enables the AWP mode.

[0537] If the value of umve_interpf_flag is 1, it is determined that the current block enables the UMVE mode or InterPF mode. At this time, it is necessary to determine the value of interpf_flag.

[0538] When determining the value of interpf_flag, at least one prediction mode is the UMVE mode and the mode to be traversed is the InterPF mode. Before decoding the coding information of interpf_flag, it is possible to determine whether the current block does not meet the enabling restrictions of the InterPF mode according to the obtained decoding information and the above-mentioned enabling restrictions allowed by the InterPF mode; if so, skip the step of decoding the coding information of interpf_flag and directly infer that the value of interpf_flag is 0; otherwise, decode the coding information of interpf_flag to determine whether the value of interpf_flag is 0 or 1.

[0539] If the value of interpf_flag is 0, it is determined that the current block enables the UMVE mode; if the value of interpf_flag is 1, it is determined that the current block enables the InterPF mode.

[0540] Embodiment Thirteen

[0541] Assume that the mode flag bits for which the values are to be determined include umve_awp_etmvp_flag, interpf_flag, umve_flag, awp_flag, affine_flag as examples. The corresponding relationship between the values of each mode flag bit and the enabling of the prediction mode is shown in Table 13.1:

[0542] Table 13.1

[0543]

[0544] Its corresponding binary tree diagram can be as Figure 5I shown.

[0545] Exemplarily, for umve_awp_etmvp_flag, interpf_flag, umve_flag, awp_flag, affine_flag, when the conditions shown in Table 13.2 are met, it is determined that the decoding conditions for the mode flag bits to be decoded are satisfied, and the coding information of the corresponding mode flag bits needs to be decoded; otherwise, it is determined that the decoding conditions for the mode flag bits to be decoded are not satisfied, and the process of decoding the coding information of the corresponding mode flag bits can be skipped, and the values of the corresponding mode flag bits can be inferred.

[0546] Table 13.2

[0547]

[0548]

[0549] Exemplarily, for the conventional direct mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode, the permitted enabling conditions can be referred to the relevant descriptions in Embodiment 4.

[0550] For the InterPF mode, the permitted enabling conditions can be referred to Embodiment 9.

[0551] Exemplarily, the syntax logic for decoding the above mode flag bits can be similar to the implementation in Embodiment 9, and will not be elaborated in this embodiment of the present application.

[0552] For Figure 5I the shown binary tree diagram, take the first value as 0 and the second value as 1 as an example.

[0553] When determining the value of umve_awp_etmvp_flag, the mode flag bit to be decoded is umve_awp_etmvp_flag, and the decoding condition of the mode flag bit to be decoded is "UMVEAvailable||AWPAvailable||ETMVPAvailable||AffineAvailable". When this condition is not met, it is determined that the decoding-free condition of the mode flag bit to be decoded is satisfied; when it is determined that this condition is met, it is determined that the decoding-free condition of the mode flag bit to be decoded is not satisfied.

[0554] Before decoding the encoded information of umve_awp_etmvp_flag, some decoding information of the current block can be obtained. According to the obtained decoding information and the permitted enabling conditions of the above UMVE mode, AWP mode, ETMVP mode, and Affine mode, it is determined whether the current block meets the decoding condition of the mode flag bit to be decoded. If it meets, it is determined that the decoding-free condition of the mode flag bit to be decoded is not satisfied, and the encoded information of umve_awp_etmvp_flag is decoded; if it does not meet, it is determined that the decoding-free condition of the mode flag bit to be decoded is satisfied, and the step of decoding the encoded information of umve_awp_etmvp_flag is skipped, and it is directly deduced that the value of umve_awp_etmvp_flag is 0.

[0555] If the value of umve_awp_etmvp_flag is 0, the value of interpf_flag needs to be determined; if the value of umve_awp_etmvp_flag is 1, the value of umve_flag needs to be determined.

[0556] When determining the value of interpf_flag, the decoding mode flag bit is interpf_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 0 and InterPFAvailable". If this condition is met, it is determined that the decoding exemption condition of the decoding mode flag bit is not satisfied; otherwise, it is determined that the decoding exemption condition of the decoding mode flag bit is satisfied.

[0557] Exemplarily, when the value of umve_awp_etmvp_affine_flag is 0 and the InterPF mode is available, it is determined that the decoding exemption condition of interpf_flag is not satisfied, the encoded information of interpf_flag is decoded, and the value of interpf_flag is determined; when the value of umve_awp_etmvp_affine_flag is 1 and / or the InterPF mode is not available, the step of decoding the encoded information of interpf_flag is skipped, and it is directly deduced that the value of interpf_flag is 0.

[0558] When determining the value of umve_flag, the decoding mode flag bit is umve_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 1 && UMVEAvailable && (AWPAvailable || ETMVPAvailable || AffineAvailable)".

[0559] When the value of umve_awp_etmvp_affine_flag is 1, the UMVE mode is available, and any one of the AWP mode, ETMVP mode, and Affine mode is available, it is determined that the decoding exemption condition of umve_flag is not satisfied; otherwise, it is determined that the decoding exemption condition of umve_flag is satisfied, the decoding of the encoded information of umve_flag is skipped, when the value of umve_awp_etmvp_affine_flag is 1 and the UMVE mode is available, it is directly deduced that the value of umve_flag is 1; when the value of umve_awp_etmvp_affine_flag is 0 and / or the UMVE mode is not available, it is directly deduced that the value of umve_flag is 0.

[0560] When the value of umve_flag is 0, it is necessary to determine the value of awp_flag.

[0561] When determining the value of awp_flag, the mode flag to be decoded is awp_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 1 && umve_flag is 0 && AWPAvailable && (ETMVPAvailable || AffineAvailable)".

[0562] If umve_awp_etmvp_affine_flag is 1, umve_flag is 0, the AWP mode is available, and either the ETMVP mode or the Affine mode is available, it is determined that the decoding exemption condition of awp_flag is not met; otherwise, it is determined that the decoding exemption condition of awp_flag is met, and the decoding of the encoded information of awp_flag is skipped. When umve_awp_etmvp_affine_flag is 1, umve_flag is 0, and the AWP mode is available, it is directly deduced that the value of awp_flag is 1; when any of the conditions that umve_awp_etmvp_affine_flag is 0, umve_flag is 1, and the AWP mode is not available holds, it is determined that the value of awp_flag is 0.

[0563] When determining that the value of awp_flag is 0, it is necessary to determine the value of affine_flag.

[0564] When determining the value of affine_flag, the mode flag to be decoded is affine_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 1 && umve_flag is 0 && awp_flag is 0 && (ETMVPAvailable || AffineAvailable)".

[0565] If the value of umve_awp_etmvp_affine_flag is 1, the value of umve_flag is 0, the value of awp_flag is 0, and either the ETMVP mode or the Affine mode is available, it is determined that the decoding condition for affine_flag is not satisfied; otherwise, it is determined that the decoding condition for affine_flag is satisfied, the decoding of the encoded information of affine_flag is skipped, and when the value of umve_awp_etmvp_affine_flag is 1, the value of umve_flag is 0, the value of awp_flag is 0, and the Affine mode is available, the value of affine_flag is directly derived as 1; when any of the conditions that the value of umve_awp_etmvp_affine_flag is 0, the value of umve_flag is 1, the value of awp_flag is 1, and the Affine mode is not available holds, the value of affine_flag is directly derived as 0.

[0566] Embodiment XIV

[0567] Taking the mode flag bits whose values are to be determined as umve_awp_etmvp_flag, interpf_flag, umve_flag, affine_flag, and awp_flag as an example, the corresponding relationship between the values of each mode flag bit and the enabled prediction mode is shown in Table 14.1:

[0568] Table 14.1

[0569]

[0570] Its corresponding binary tree diagram can be as Figure 5J shown.

[0571] Exemplarily, for umve_awp_etmvp_flag, interpf_flag, umve_flag, affine_flag, and awp_flag, when the conditions shown in Table 14.2 are met, it is determined that the decoding condition for the mode flag bit to be decoded is satisfied, and the encoded information of the corresponding mode flag bit needs to be decoded; otherwise, it is determined that the decoding condition for the mode flag bit to be decoded is not satisfied, and the process of decoding the encoded information of the corresponding mode flag bit can be skipped, and the value of the corresponding mode flag bit is derived.

[0572] Table 14.2

[0573]

[0574]

[0575] Exemplarily, for the conventional direct mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode, the enabling restrictions can be referred to the relevant descriptions in Embodiment 4.

[0576] For the InterPF mode, the enabling restrictions can be referred to Embodiment 9.

[0577] Exemplarily, the syntax logic for decoding the above mode flag bits can be similar to the implementation in Embodiment 9, and details are not described herein in this embodiment of the present application.

[0578] For Figure 5J the shown binary tree diagram, take the first value as 0 and the second value as 1 as an example.

[0579] When determining the value of umve_awp_etmvp_flag, the mode flag bit to be decoded is umve_awp_etmvp_flag, and the decoding condition of the mode flag bit to be decoded is "UMVEAvailable||AWPAvailable||ETMVPAvailable||AffineAvailable". When this condition is not met, it is determined that the decoding-free condition of the mode flag bit to be decoded is satisfied; when it is determined that this condition is met, it is determined that the decoding-free condition of the mode flag bit to be decoded is not satisfied.

[0580] Before decoding the coding information of umve_awp_etmvp_flag, some decoding information of the current block can be obtained. According to the obtained decoding information and the enabling restrictions of the above UMVE mode, AWP mode, ETMVP mode, and Affine mode, it is determined whether the current block meets the decoding condition of the mode flag bit to be decoded. If it meets, it is determined that the decoding-free condition of the mode flag bit to be decoded is not satisfied, and the coding information of umve_awp_etmvp_flag is decoded; if it does not meet, it is determined that the decoding-free condition of the mode flag bit to be decoded is satisfied, and the step of decoding the coding information of umve_awp_etmvp_flag is skipped, and it is directly deduced that the value of umve_awp_etmvp_flag is 0.

[0581] If the value of umve_awp_etmvp_flag is 0, the value of interpf_flag needs to be determined; if the value of umve_awp_etmvp_flag is 1, the value of umve_flag needs to be determined.

[0582] When determining the value of interpf_flag, the decoding mode flag bit is interpf_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 0 and InterPFAvailable". If this condition is met, it is determined that the decoding exemption condition of the decoding mode flag bit is not satisfied; otherwise, it is determined that the decoding exemption condition of the decoding mode flag bit is satisfied.

[0583] Exemplarily, when the value of umve_awp_etmvp_affine_flag is 0 and the InterPF mode is available, it is determined that the decoding exemption condition of interpf_flag is not satisfied, the encoded information of interpf_flag is decoded, and the value of interpf_flag is determined; when the value of umve_awp_etmvp_affine_flag is 1 and / or the InterPF mode is not available, the step of decoding the encoded information of interpf_flag is skipped, and it is directly deduced that the value of interpf_flag is 0.

[0584] When determining the value of umve_flag, the decoding mode flag bit is umve_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 1 && UMVEAvailable && (AWPAvailable || ETMVPAvailable || AffineAvailable)".

[0585] When the value of umve_awp_etmvp_affine_flag is 1, the UMVE mode is available, and any one of the AWP mode, ETMVP mode, and Affine mode is available, it is determined that the decoding exemption condition of umve_flag is not satisfied; otherwise, it is determined that the decoding exemption condition of umve_flag is satisfied, the decoding of the encoded information of umve_flag is skipped, when the value of umve_awp_etmvp_affine_flag is 1 and the UMVE mode is available, it is directly deduced that the value of umve_flag is 1; when the value of umve_awp_etmvp_affine_flag is 0 and / or the UMVE mode is not available, it is directly deduced that the value of umve_flag is 0.

[0586] When the value of umve_flag is 0, it is necessary to determine the value of affine_flag.

[0587] When determining the value of affine_flag, the mode flag to be decoded is affine_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 1 && umve_flag is 0 && AffineAvailable && (ETMVPAvailable || AWPAvailable)".

[0588] If umve_awp_etmvp_affine_flag is 1, umve_flag is 0, Affine mode is available, and either the ETMVP mode or the AWP mode is available, it is determined that the decoding exemption condition for affine_flag is not met; otherwise, it is determined that the decoding exemption condition for affine_flag is met, and the decoding of the encoding information of affine_flag is skipped. When umve_awp_etmvp_affine_flag is 1, umve_flag is 0, and Affine mode is available, it is directly deduced that the value of affine_flag is 1; when any of the conditions that umve_awp_etmvp_affine_flag is 0, umve_flag is 1, and Affine mode is not available holds, it is directly deduced that the value of affine_flag is 0.

[0589] When determining that the value of affine_flag is 0, it is necessary to determine the value of awp_flag.

[0590] When determining the value of awp_flag, the mode flag to be decoded is awp_flag, and its decoding condition is "umve_awp_etmvp_affine_flag is 1 && umve_flag is 0 && affine_flag is 0 && (ETMVPAvailable || AwpAvailable)".

[0591] If the value of umve_awp_etmvp_affine_flag is 1, the value of umve_flag is 0, the value of affine_flag is 0, and either the ETMVP mode or the AWP mode is available, it is determined that the decoding-free condition of awp_flag is not satisfied; otherwise, it is determined that the decoding-free condition of awp_flag is satisfied, the decoding of the encoded information of awp_flag is skipped, and when the value of umve_awp_etmvp_affine_flag is 1, the value of umve_flag is 0, the value of affine_flag is 0, and the AWP mode is available, the value of awp_flag is directly deduced to be 1; when any of the conditions that the value of umve_awp_etmvp_affine_flag is 0, the value of umve_flag is 1, the value of affine_flag is 1, and the AWP mode is unavailable holds, the value of awp_flag is directly deduced to be 0.

[0592] It should be noted that the setting of the mode flag bits in the above embodiments is only an example of the setting method of the mode flag bits in the embodiments of the present application, rather than a limitation on the protection scope of the embodiments of the present application. In the embodiments of the present application, the setting of the mode flag bits may also include other implementation manners, and it may be set according to the usage probability of each mode in accordance with the principle of "for a prediction mode with a larger usage probability, the mode flag bit uses a shorter codeword; for a mode with a larger usage probability, the mode flag bit uses a longer codeword". For example, for a mode with a larger probability, the mode flag bit may be closer to the root node of the binary tree; for a mode with a smaller probability, the mode flag bit may be farther from the root node of the binary tree; or, new embodiments may also be obtained by combining any of the above-mentioned embodiments, and the specific implementation thereof will not be elaborated herein.

[0593] In addition, for any mode flag bit, the candidate prediction modes in different value cases are not limited to the above examples. For example, taking Figure 5A the binary tree diagram shown as an example, for umve_awp_etmvp_flag, it is also possible to determine to enable the conventional skip mode or the Affine mode when the value of umve_awp_etmvp_flag is 1; for affine_flag, it is also possible to determine to enable the Affine mode when the value of affine_flag is 0, and the specific implementation thereof will not be elaborated herein.

[0594] Furthermore, the above embodiments are described in terms of the decoding process at the decoding end, and the implementation at the encoding end can refer to the relevant description of the decoding end process.

[0595] The method provided by the present application has been described above. Next, the device provided by the present application will be described:

[0596] Please refer to Figure 6 which is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. The electronic device may include a processor 601 and a machine-readable storage medium 602 storing machine-executable instructions. The processor 601 and the machine-readable storage medium 602 may communicate via a system bus 603. And by reading and executing the machine-executable instructions corresponding to the decoding control or encoding control logic in the machine-readable storage medium 602, the processor 601 may execute the prediction mode decoding method or the prediction mode encoding method described above.

[0597] The machine-readable storage medium 602 mentioned herein may be any electronic, magnetic, optical or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.

[0598] In some embodiments, a machine-readable storage medium is also provided, which stores machine-executable instructions therein. When the machine-executable instructions are executed by a processor, the prediction mode decoding method or the prediction mode encoding method described above is implemented. For example, the machine-readable storage medium may be ROM, RAM, CD-ROM, magnetic tapes, floppy disks, and optical data storage devices, etc.

[0599] In these embodiments, as Figure 7 shown, when the above-mentioned electronic device is used as a decoding-end device, the above-mentioned decoding control logic may include:

[0600] A judgment unit 710, configured to, for a current block, before decoding the binary-coded information of the to-be-decoded mode flag bit, judge whether the current block meets the decoding-free condition of the to-be-decoded mode flag bit according to the specific information of the current block;

[0601] A decoding unit 720, configured to, if the current block meets the decoding-free condition of the to-be-decoded mode flag bit, determine that the binary value of the to-be-decoded mode flag bit is a first value or a second value according to the specific information;

[0602] The decoding unit 720 is further configured to, if the current block does not meet the decoding-free condition of the to-be-decoded mode flag bit, read the binary-coded information of the to-be-decoded mode flag bit, decode the coded information, and determine that the binary value of the to-be-decoded mode flag bit is a first value or a second value;

[0603] Among them, the specific information includes the value of at least one acquired pattern flag bit and / or the decoding information for predicting whether at least one pattern is available.

[0604] As an example, the determining unit 710 is further configured to, before decoding the binary encoding information of the control switch flag bit of the first target prediction mode, obtain and determine whether the current block satisfies the decoding-free condition of the first target prediction mode according to the decoding information of the current block;

[0605] The decoding unit 720 is further configured to, if the current block satisfies the decoding-free condition of the first target prediction mode, skip the step of decoding the binary encoding information of the control switch flag bit of the first target prediction mode, and determine that the binary value of the control switch flag bit of the first target prediction mode is the first value;

[0606] If the current block does not satisfy the decoding-free condition of the first target prediction mode, then execute the step of decoding the binary encoding information of the control switch flag bit of the first target prediction mode;

[0607] If the decoded binary value of the control switch flag bit of the first target prediction mode is the second value, then execute the step of determining whether the current block satisfies the decoding-free condition of the to-be-decoded mode flag bit according to the specific information of the current block.

[0608] As an example, the determining unit 710 is further configured to, before decoding the binary encoding information of the control switch flag bit of the second target prediction mode, obtain and determine whether the current block satisfies the decoding-free condition of the second target prediction mode according to the decoding information of the current block;

[0609] The decoding unit 720 is further configured to, if the current block satisfies the decoding-free condition of the second target prediction mode, skip the step of decoding the binary encoding information of the control switch flag bit of the second target prediction mode, and determine that the binary value of the control switch flag bit of the second target prediction mode is the first value;

[0610] If the current block does not satisfy the decoding-free condition of the second target prediction mode, then execute the step of decoding the binary encoding information of the control switch flag bit of the second target prediction mode;

[0611] If the decoded binary value of the control switch flag bit of the second target prediction mode is the second value, then execute the step of obtaining and determining whether the current block satisfies the decoding-free condition of the first target prediction mode according to the decoding information of the current block.

[0612] As an example, when the skip mode is enabled, the at least one prediction mode includes one or more of a conventional skip mode, an Affine mode, an advanced motion vector representation mode (UMVE mode), an angular weighted prediction mode (AWP mode), and an enhanced temporal motion vector prediction mode (ETMVP mode).

[0613] As an example, the decoding skip conditions for the first target prediction mode include one or more of the following:

[0614] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0615] The sum of the width and height of the current block is less than a first threshold.

[0616] As an example, the first target prediction mode is a direct mode, and the second target prediction mode is a skip mode;

[0617] When the direct mode is enabled, the at least one prediction mode includes one or more of a conventional direct mode, an InterPF mode, an Affine mode, a UMVE mode, an AWP mode, and an ETMVP mode.

[0618] As an example, the decoding skip conditions for the first target prediction mode include one or more of the following:

[0619] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0620] The sum of the width and height of the current block is less than a second threshold;

[0621] The decoding skip conditions for the second target prediction mode include one or more of the following:

[0622] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0623] The sum of the width and height of the current block is less than a third threshold.

[0624] As an example, for any prediction mode in the at least one prediction mode, the decoding information indicating whether it is available includes one or more of a switch state information, a size information of the current block, and a frame type information.

[0625] As an example, for any prediction mode in the at least one prediction mode, determining whether it is available based on the decoding information indicating whether it is available includes:

[0626] Determine whether the current block meets the restrictive conditions allowed to be enabled by the prediction mode based on the decoding information on whether the prediction mode is available;

[0627] If it meets the conditions, determine that the prediction mode is available; otherwise, determine that the prediction mode is unavailable;

[0628] When the prediction mode is the UMVE mode, the restrictive conditions allowed to be enabled include that the sequence-level switch of the UMVE mode is in the on state;

[0629] When the prediction mode is the AWP mode, the restrictive conditions allowed to be enabled include one or more of the following:

[0630] The sequence-level switch of the AWP mode is in the on state, the product of the width and height of the current block is greater than or equal to the first size threshold, the width of the current block is less than or equal to the first width threshold, the height of the current block is less than or equal to the first height threshold, and the frame type of the frame to which the current block belongs is a B frame;

[0631] When the prediction mode is the ETMVP mode, the restrictive conditions allowed to be enabled include one or more of the following:

[0632] The sequence-level switch of the ETMVP mode is in the on state, the width of the current block is greater than or equal to the second width threshold, and the height of the current block is greater than or equal to the second height threshold;

[0633] When the prediction mode is the Affine mode, the restrictive conditions allowed to be enabled include one or more of the following:

[0634] The sequence-level switch of the Affine mode is in the on state, the width of the current block is greater than or equal to the third width threshold, and the height of the current block is greater than or equal to the third height threshold;

[0635] When the prediction mode is the InterPF mode, the restrictive conditions allowed to be enabled include one or more of the following;

[0636] The sequence-level switch of the InterPF mode is in the on state, the product of the width and height of the current block is greater than or equal to the second size threshold, the width of the current block is less than or equal to the fourth width threshold, and the height of the current block is less than or equal to the fourth height threshold.

[0637] In some of these embodiments, as Figure 8 shown, when the above electronic device is an encoding end device, the above encoding control logic may include:

[0638] A judgment unit 810, configured to, for the current block, before writing the binary encoding information of the to-be-encoded mode flag bit into the code stream, judge whether the current block meets the non-encoding condition of the to-be-encoded mode flag bit;

[0639] An encoding unit 820, configured to skip the step of writing the binary encoding information of the to-be-encoded mode flag bit into the code stream if the current block meets the no-encoding condition of the to-be-encoded mode flag bit;

[0640] The encoding unit 820 is further configured to write the binary encoding information of the to-be-encoded mode flag bit into the code stream if the current block does not meet the no-encoding condition of the to-be-encoded mode flag bit.

[0641] As an example, the determination unit 810 is further configured to determine whether the current block meets the no-decoding condition of the first target prediction mode before the encoding unit writes the binary encoding information of the control switch flag bit of the first target prediction mode into the code stream;

[0642] The encoding unit 820 is further configured to skip the step of writing the binary encoding information of the control switch flag bit of the first target prediction mode into the code stream and determine that the binary value of the control switch flag bit of the first target prediction mode is the first value if the current block meets the no-decoding condition of the first target prediction mode;

[0643] If the current block does not meet the no-decoding condition of the first target prediction mode, execute the step of writing the binary encoding information of the control switch flag bit of the first target prediction mode into the code stream;

[0644] If the binary value of the control switch flag bit of the first target prediction mode is the second value, determine to execute the step of determining whether the current block meets the no-encoding condition of the to-be-encoded mode flag bit.

[0645] As an example, the determination unit is further configured to determine whether the current block meets the no-decoding condition of the second target prediction mode before the encoding unit writes the binary encoding information of the control switch flag bit of the second target prediction mode into the code stream;

[0646] If the current block meets the no-decoding condition of the second target prediction mode, skip the step of writing the binary encoding information of the control switch flag bit of the second target prediction mode into the code stream and determine that the binary value of the control switch flag bit of the second target prediction mode is the first value;

[0647] If the current block does not meet the no-decoding condition of the second target prediction mode, execute the step of writing the binary encoding information of the control switch flag bit of the second target prediction mode into the code stream;

[0648] If the binary value of the control switch flag bit of the second target prediction mode is the second value, determine to execute the step of determining whether the current block meets the disabling condition of the first target prediction mode.

[0649] As an example, the first target prediction mode is the skip mode;

[0650] At least one of the above prediction modes includes one or more prediction modes among the candidate prediction modes when the skip mode is enabled;

[0651] When the skip mode is enabled, at least one of the above prediction modes includes one or more of the conventional skip mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode.

[0652] As an example, the non-decoding conditions of the first target prediction mode include one or more of the following:

[0653] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0654] The sum of the width and height of the current block is less than a first threshold.

[0655] As an example, the first threshold is 16.

[0656] As an example, the first target prediction mode is the direct mode, and the second target prediction mode is the skip mode;

[0657] When the direct mode is enabled, at least one of the above prediction modes includes one or more of the conventional direct mode, InterPF mode, Affine mode, UMVE mode, AWP mode, and ETMVP mode.

[0658] As an example, the non-decoding conditions of the first target prediction mode include one or more of the following:

[0659] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0660] The sum of the width and height of the current block is less than a second threshold;

[0661] The non-decoding conditions of the second target prediction mode include one or more of the following:

[0662] The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;

[0663] The sum of the width and height of the current block is less than a third threshold.

[0664] As an example, the second threshold is 16, and / or the third threshold is 16.

[0665] As an example, for any one of the at least one prediction mode, the decoding information indicating whether it is available includes one or more of switch state information, size information of the current block, and frame type information.

[0666] As an example, for any one of the above at least one prediction mode, determining whether it is available based on the decoding information indicating whether it is available includes:

[0667] Based on the decoding information indicating whether the prediction mode is available, determining whether the current block meets the enabling restriction conditions allowed by the prediction mode;

[0668] If it meets the conditions, determine that the prediction mode is available; otherwise, determine that the prediction mode is unavailable;

[0669] When the prediction mode is the UMVE mode, the enabling restriction conditions it allows include that the sequence-level switch of the UMVE mode is in the on state;

[0670] When the prediction mode is the AWP mode, the enabling restriction conditions it allows include one or more of the following:

[0671] The sequence-level switch of the AWP mode is in the on state, the product of the width and height of the current block is greater than or equal to the first size threshold, the width of the current block is less than or equal to the first width threshold, the height of the current block is less than or equal to the first height threshold, and the type of the slice to which the current block belongs is SLICE_B;

[0672] When the prediction mode is the ETMVP mode, the enabling restriction conditions it allows include one or more of the following:

[0673] The sequence-level switch of the ETMVP mode is in the on state, the width of the current block is greater than or equal to the second width threshold, and the height of the current block is greater than or equal to the second height threshold;

[0674] When the prediction mode is the Affine mode, the enabling restriction conditions it allows include one or more of the following:

[0675] The sequence-level switch including the Affine mode is in the on state, the width of the current block is greater than or equal to the third width threshold, and the height of the current block is greater than or equal to the third height threshold;

[0676] When the prediction mode is the InterPF mode, the enabling restriction conditions it allows include one or more of the following;

[0677] The sequence-level switch of the InterPF mode is in the on state, the product of the width and height of the current block is greater than or equal to the second size threshold, the width of the current block is less than or equal to the fourth width threshold, and the height of the current block is less than or equal to the fourth height threshold.

[0678] In some embodiments, a camera device is further provided, including the prediction mode decoding device or the prediction mode encoding device in the above embodiments.

[0679] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including an..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0680] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of protection of the present application.

Claims

1. A prediction mode decoding method, characterized in that, Including: For the current block, before decoding the binary-coded information of the to-be-decoded mode flag bit, determine whether the current block meets the decoding-free condition of the to-be-decoded mode flag bit according to the specific information of the current block; If the current block meets the decoding-free condition of the to-be-decoded mode flag bit, then determine that the binary value of the to-be-decoded mode flag bit is the first value or the second value according to the specific information; If the current block does not meet the decoding-free condition of the to-be-decoded mode flag bit, then read the binary-coded information of the to-be-decoded mode flag bit, decode the coded information, and determine that the binary value of the to-be-decoded mode flag bit is the first value or the second value; Wherein, the specific information includes the values of at least one already obtained mode flag bit and / or the decoding information on whether at least one prediction mode is available; For any one of the at least one prediction modes, the decoding information on whether it is available includes one or more of switch state information, size information of the current block, and frame type information; Wherein, the to-be-decoded mode flag bit includes a first flag bit; the first flag bit is used to indicate whether the current coding unit uses the advanced motion vector representation mode (UMVE mode) or the angular weighted prediction mode (AWP mode) or the enhanced motion vector prediction mode (ETMVP mode); when the value of the first flag bit is 0, it indicates that the current coding unit does not use any of the prediction modes of the UMVE mode, the AWP mode, and the ETMVP mode; when the value of the first flag bit is 1, it indicates that the current coding unit uses the UMVE mode, the AWP mode, or the ETMVP mode; Determining whether the current block meets the decoding-free condition of the first flag bit according to the specific information of the current block includes: If the current block does not meet the enabling restriction conditions allowed by the UMVE mode, the AWP mode, and the ETMVP mode, then determine that the current block meets the decoding-free condition of the first flag bit; If the current block meets the enabling restriction condition of any one of the prediction modes of the UMVE mode, the AWP mode, and the ETMVP mode, then determine that the current block does not meet the decoding-free condition of the first flag bit.

2. The method according to claim 1, wherein Before determining whether the current block meets the decoding-free condition of the to-be-decoded mode flag bit according to the specific information of the current block, the method further includes: Before decoding the binary-coded information of the control switch flag bit of the first target prediction mode, obtain and determine whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block; If the current block meets the decoding-free condition of the first target prediction mode, then skip the step of decoding the binary-coded information of the control switch flag bit of the first target prediction mode, and determine that the binary value of the control switch flag bit of the first target prediction mode is the first value; If the current block does not meet the decoding-free condition of the first target prediction mode, then execute the step of decoding the binary-coded information of the control switch flag bit of the first target prediction mode; If the binary value of the control switch flag of the first target prediction mode is decoded as the second value, then execute the step of determining whether the current block meets the decoding-free condition of the to-be-decoded mode flag according to the specific information of the current block.

3. The method according to claim 2, characterized in that, Before obtaining and determining whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block, the method further includes: Before decoding the binary coded information of the control switch flag of the second target prediction mode, obtain and determine whether the current block meets the decoding-free condition of the second target prediction mode according to the decoding information of the current block; If the current block meets the decoding-free condition of the second target prediction mode, then skip the step of decoding the binary coded information of the control switch flag of the second target prediction mode, and determine that the binary value of the control switch flag of the second target prediction mode is the first value; If the current block does not meet the decoding-free condition of the second target prediction mode, then execute the step of decoding the binary coded information of the control switch flag of the second target prediction mode; If the binary value of the control switch flag of the second target prediction mode is decoded as the second value, then execute the step of obtaining and determining whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block.

4. The method according to claim 2, wherein The first target prediction mode is the skip mode; When the skip mode is enabled, the at least one prediction mode includes one or more of a conventional skip mode, an Affine mode, an advanced motion vector representation mode (UMVE mode), an angle weighted prediction mode (AWP mode), and an enhanced temporal motion vector prediction mode (ETMVP mode).

5. The method according to claim 4, characterized in that, The decoding-free conditions of the first target prediction mode include one or more of the following: The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode.

6. The method according to claim 3, wherein The first target prediction mode is the direct mode, and the second target prediction mode is the skip mode; When the direct mode is enabled, the at least one prediction mode includes one or more of a conventional direct mode, an InterPF mode, an Affine mode, a UMVE mode, an AWP mode, and an ETMVP mode.

7. The method according to claim 6, characterized in that, The decoding-free conditions of the first target prediction mode include one or more of the following: The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode; The decoding-free conditions of the second target prediction mode include one or more of the following: The current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode.

8. The method according to claim 7, wherein For any one of the at least one prediction modes, determining whether it is available based on the decoding information of whether the prediction mode is available includes: Based on the decoding information of whether the prediction mode is available, determine whether the current block meets the limiting conditions allowed for enabling the prediction mode; If it meets the conditions, determine that the prediction mode is available; otherwise, determine that the prediction mode is not available. When the prediction mode is the UMVE mode, the enabling restriction conditions include that the sequence-level switch of the UMVE mode is in the on state; When the prediction mode is the AWP mode, the enabling restriction conditions include one or more of the following: The sequence-level switch of the AWP mode is in the on state, the product of the width and height of the current block is greater than or equal to the first size threshold, the width of the current block is less than or equal to the first width threshold, the height of the current block is less than or equal to the first height threshold, and the frame type of the frame to which the current block belongs is a B frame; When the prediction mode is the ETMVP mode, the enabling restriction conditions include one or more of the following: The sequence-level switch of the ETMVP mode is in the on state, the width of the current block is greater than or equal to the second width threshold, and the height of the current block is greater than or equal to the second height threshold; When the prediction mode is the Affine mode, the enabling restriction conditions include one or more of the following: The sequence-level switch of the Affine mode is in the on state, the width of the current block is greater than or equal to the third width threshold, and the height of the current block is greater than or equal to the third height threshold; When the prediction mode is the InterPF mode, the enabling restriction conditions include one or more of the following; The sequence-level switch of the InterPF mode is in the on state, the product of the width and height of the current block is greater than or equal to the second size threshold, the width of the current block is less than or equal to the fourth width threshold, and the height of the current block is less than or equal to the fourth height threshold.

9. A prediction mode coding method, characterized in that Including: For the current block, before writing the binary coding information of the to-be-encoded mode flag bit into the bitstream, determine whether the current block meets the no-encoding condition of the to-be-encoded mode flag bit; If the current block meets the no-encoding condition of the to-be-encoded mode flag bit, skip the step of writing the binary coding information of the to-be-encoded mode flag bit into the bitstream; If the current block does not meet the no-encoding condition of the to-be-encoded mode flag bit, write the binary coding information of the to-be-encoded mode flag bit into the bitstream; Among them, the to-be-encoded mode flag bit includes a first flag bit; the first flag bit is used to indicate whether the current coding unit uses an advanced motion vector representation mode (UMVE mode) or an angular weighted prediction mode (AWP mode) or an enhanced motion vector prediction mode (ETMVP mode); when the value of the first flag bit is 0, it indicates that the current coding unit does not use any of the UMVE mode, AWP mode, and ETMVP mode; when the value of the first flag bit is 1, it indicates that the current coding unit uses the UMVE mode, AWP mode, or ETMVP mode; Determining whether the current block meets the no-encoding condition of the to-be-encoded mode flag bit includes: If the current block does not meet the enabling restriction conditions of the UMVE mode, AWP mode, and ETMVP mode, determine that the current block meets the no-encoding condition of the first flag bit; If the current block meets the enabling restriction conditions of any one of the UMVE mode, AWP mode, and ETMVP mode, determine that the current block does not meet the no-encoding condition of the first flag bit.

10. A decoding device, characterized in that, Including: A determination unit, configured to, for a current block, before decoding the binary-coded information of the to-be-decoded mode flag bit, determine whether the current block meets the decoding-free condition of the to-be-decoded mode flag bit according to the specific information of the current block; A decoding unit, configured to, if the current block meets the decoding-free condition of the to-be-decoded mode flag bit, determine, according to the specific information, that the binary value of the to-be-decoded mode flag bit is a first value or a second value; The decoding unit is further configured to, if the current block does not meet the decoding-free condition of the to-be-decoded mode flag bit, read the binary-coded information of the to-be-decoded mode flag bit, decode the coded information, and determine that the binary value of the to-be-decoded mode flag bit is a first value or a second value; Wherein, the specific information includes the values of at least one already obtained mode flag bit and / or the decoding information on whether at least one prediction mode is available; For any one of the at least one prediction modes, the decoding information on whether it is available includes one or more of switch state information, size information of the current block, and frame type information; Wherein, the to-be-decoded mode flag bit includes a first flag bit; the first flag bit is used to indicate whether the current coding unit uses an advanced motion vector representation mode (UMVE mode), an angular weighted prediction mode (AWP mode), or an enhanced motion vector prediction mode (ETMVP mode); when the value of the first flag bit is 0, it indicates that the current coding unit does not use any of the prediction modes of the UMVE mode, the AWP mode, and the ETMVP mode; when the value of the first flag bit is 1, it indicates that the current coding unit uses the UMVE mode, the AWP mode, or the ETMVP mode; The determination unit determines whether the current block meets the decoding-free condition of the first flag bit according to the specific information of the current block, including: If the current block does not meet any of the enabling limit conditions allowed by the UMVE mode, the AWP mode, and the ETMVP mode, it is determined that the current block meets the decoding-free condition of the first flag bit; If the current block meets any of the enabling limit conditions allowed by the UMVE mode, the AWP mode, and the ETMVP mode, it is determined that the current block does not meet the decoding-free condition of the first flag bit.

11. An encoding device, characterized in that, Including: A determination unit, configured to, for a current block, before writing the binary-coded information of the to-be-encoded mode flag bit into the code stream, determine whether the current block meets the encoding-free condition of the to-be-encoded mode flag bit; An encoding unit, configured to, if the current block meets the encoding-free condition of the to-be-encoded mode flag bit, skip the step of writing the binary-coded information of the to-be-encoded mode flag bit into the code stream; The encoding unit is further configured to, if the current block does not meet the encoding-free condition of the to-be-encoded mode flag bit, write the binary-coded information of the to-be-encoded mode flag bit into the code stream; Among them, the to-be-encoded mode flag bit includes a first flag bit; the first flag bit is used to indicate whether the current encoding unit uses an advanced motion vector representation mode (UMVE mode), an angular weighted prediction mode (AWP mode), or an enhanced motion vector prediction mode (ETMVP mode); when the value of the first flag bit is 0, it indicates that the current encoding unit does not use any of the prediction modes of the UMVE mode, the AWP mode, and the ETMVP mode; when the value of the first flag bit is 1, it indicates that the current encoding unit uses the UMVE mode, the AWP mode, or the ETMVP mode. Determining whether the current block meets the encoding-free condition of the to-be-encoded mode flag bit includes: If the current block does not meet any of the enabling restriction conditions allowed by the UMVE mode, the AWP mode, and the ETMVP mode, it is determined that the current block meets the encoding-free condition of the first flag bit; If the current block meets any of the enabling restriction conditions allowed by the UMVE mode, the AWP mode, and the ETMVP mode, it is determined that the current block does not meet the encoding-free condition of the first flag bit.

12. An electronic device, characterized in that, It includes a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is used to execute the machine-executable instructions to implement the prediction mode decoding method according to any one of claims 1-8 or the prediction mode encoding method according to claim 9.

Citation Information

Patent Citations

  • Method and device for decoding and encoding prediction modes

    CN110933408A