CN114598878A - Prediction mode decoding and encoding method and device - Google Patents

Prediction mode decoding and encoding method and device Download PDF

Info

Publication number
CN114598878A
CN114598878A CN202011410497.6A CN202011410497A CN114598878A CN 114598878 A CN114598878 A CN 114598878A CN 202011410497 A CN202011410497 A CN 202011410497A CN 114598878 A CN114598878 A CN 114598878A
Authority
CN
China
Prior art keywords
mode
flag
current block
decoding
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011410497.6A
Other languages
Chinese (zh)
Inventor
陈方栋
曹小强
孙煜程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202011410497.6A priority Critical patent/CN114598878A/en
Priority to CN202111673156.2A priority patent/CN114339236B/en
Publication of CN114598878A publication Critical patent/CN114598878A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application provides a prediction mode decoding method, a prediction mode encoding method and a prediction mode encoding device, wherein the prediction mode decoding method comprises the following steps: for a current block, before the binary coding information of a mode marking bit to be decoded is decoded, judging whether the current block meets the decoding-free condition of the mode marking bit to be decoded according to the specific information of the current block; if the current block meets the decoding-free condition of the mark bit of the mode to be decoded, determining the binarization value of the mark bit of the mode to be decoded as a first value or a second value according to the specific information; and if the current block does not meet the decoding-free condition of the mode marking bit to be decoded, reading the binary coding information of the mode marking bit to be decoded, decoding the coding information, and determining that the binary value of the mode marking bit to be decoded is a first value or a second value. The method can improve the performance of coding and decoding.

Description

Prediction mode decoding and encoding method and device
Technical Field
The present application relates to video image encoding and decoding technologies, and in particular, to a prediction mode decoding method, a prediction mode encoding method, and a prediction mode encoding device.
Background
The prediction mode refers to a mode of decoding or encoding an image block in a video frame. Since the prediction modes include a plurality of modes, one control switch flag bit is configured for each prediction mode, and whether the corresponding prediction mode is started by the control switch flag bit is controlled. And the encoding end controls a switch flag bit through encoding to indicate which prediction mode is enabled for the image block. The decoding end can decode the coding of the control switch flag bit to determine the prediction mode adopted by the image block.
In the related art, when a current block is coded, for any prediction mode, a coding end judges whether the prediction mode is started, and if the prediction mode is started, a control switch flag bit value of a coding prediction mode A is 1; if the coding prediction mode A is not started, the flag bit of the control switch of the coding prediction mode A takes a value of 0. After the control switch flag bits of each prediction mode are encoded according to the method, the decoding end decodes the control switch flag bits of the prediction mode when decoding the current block, and if the decoded control switch flag bits take the value of 1, the current block is determined to start the prediction mode.
In this way, the decoding end needs to decode the control switch flag bit to determine whether the current block enables the prediction mode, which results in low efficiency of encoding and decoding the prediction mode.
Disclosure of Invention
In view of the above, the present application provides a prediction mode decoding method, a prediction mode encoding method, and a prediction mode decoding apparatus.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of embodiments of the present application, there is provided a prediction mode decoding method, including:
for a current block, before the binary coding information of a mode marking bit to be decoded is decoded, judging whether the current block meets the decoding-free condition of the mode marking bit to be decoded according to the specific information of the current block;
if the current block meets the decoding-free condition of the mark bit of the mode to be decoded, determining the binarization value of the mark bit of the mode to be decoded as a first value or a second value according to the specific information;
if the current block does not meet the decoding-free condition of the mode marking bit to be decoded, reading the binary coding information of the mode marking bit to be decoded, decoding the coding information, and determining that the binary value of the mode marking bit to be decoded is a first value or a second value;
wherein the specific information includes a value of at least one obtained mode flag bit and/or decoding information whether at least one prediction mode is available.
According to a second aspect of the embodiments of the present application, there is provided a prediction mode encoding method, including:
aiming at a current block, before writing binary coding information of a mode marking bit to be coded into a code stream, judging whether the current block meets a coding-free condition of the mode marking bit to be coded;
if the current block meets the coding-free condition of the marking bit of the mode to be coded, skipping the step of writing the binaryzation coding information of the marking bit of the mode to be coded into a code stream;
and if the current block does not meet the coding-free condition of the mode marking bit to be coded, writing the binary coding information of the mode marking bit to be coded into a code stream.
According to a third aspect of embodiments of the present application, there is provided a decoding apparatus including:
the judging unit is used for judging whether the current block meets the decoding-free condition of the mark bit of the mode to be decoded according to the specific information of the current block before the binary coding information of the mark bit of the mode to be decoded is decoded for the current block;
a decoding unit, configured to determine, according to the specific information, that a binary value of the to-be-decoded mode flag bit is a first value or a second value if the current block satisfies a decoding-free condition of the to-be-decoded mode flag bit;
the decoding unit is further configured to, if the current block does not satisfy the decoding-free condition of the to-be-decoded mode flag bit, read the binarization encoding information of the to-be-decoded mode flag bit, decode the encoding information, and determine that the binarization value of the to-be-decoded mode flag bit is a first value or a second value;
wherein the specific information includes a value of at least one obtained mode flag bit and/or decoding information whether at least one prediction mode is available.
According to a fourth aspect of embodiments of the present application, there is provided an encoding apparatus including:
the coding unit is used for judging whether the current block meets the coding-free condition of the mode marking bit to be coded or not before writing the binary coding information of the mode marking bit to be coded into a code stream aiming at the current block;
the coding unit is further used for skipping the step of writing the binaryzation coding information of the mode marking bit to be coded into a code stream if the current block meets the coding-free condition of the mode marking bit to be coded; and if the current block does not meet the coding-free condition of the mode marking bit to be coded, writing the binary coding information of the mode marking bit to be coded into a code stream.
According to a fifth aspect of embodiments herein, there is provided an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being 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.
According to the prediction mode decoding method, before the binarization coding information of the mode marking bit to be decoded is decoded, whether the current decoding-free condition of the mode marking bit to be decoded is met or not is judged based on the specific information of the current block, and the binarization value of the mode marking bit to be decoded is determined according to the specific information without decoding the binarization coding information of the mode marking bit to be decoded under the condition that the current block meets the decoding-free condition of the mode marking bit to be decoded, so that the binarization value of the mode marking bit to be decoded is determined under the condition that the binarization coding information of the mode marking bit to be decoded is not decoded, coding bits can be saved, and coding and decoding performance is improved.
Drawings
Fig. 1A is a schematic diagram of weight derivation for an AWP pattern shown in an exemplary embodiment of the present application;
fig. 1B is a schematic diagram of an ETMVP mode shown in an exemplary embodiment of the present application;
FIG. 1C is a diagram illustrating a relationship between an original matching block and spatially neighboring blocks according to an exemplary embodiment of the present application;
FIGS. 2A-2B are schematic diagrams of block partitions shown in an exemplary embodiment of the present application;
FIG. 3 is a flow chart diagram illustrating a method of prediction mode decoding in an exemplary embodiment of the present application;
FIG. 4 is a flow chart diagram illustrating a method of prediction mode encoding according to an exemplary embodiment of the present application;
5A-5J are schematic diagrams of binary tree of mode flag bits shown in the embodiments of the present application;
FIG. 6 is a diagram illustrating a hardware configuration of an electronic device according to an exemplary embodiment of the present application;
fig. 7 is a schematic diagram illustrating a decoding apparatus according to an exemplary embodiment of the present application;
fig. 8 is a schematic structural diagram illustrating an encoding apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In order to make those skilled in the art better understand the technical solutions provided by the embodiments of the present application, a brief description will be given below of the block division technique in the existing video coding standard, the existing intra sub-block division scheme, and some technical terms related to the embodiments of the present application.
In order to make those skilled in the art better understand the technical solutions provided by the embodiments of the present application, a part of technical terms related to the embodiments of the present application and a main flow of video encoding and decoding are briefly described below.
Technical terms
1. Flag Coding (Flag Coding): in video coding, there are many prediction modes such as skip mode, direct mode, etc. For a block, it may use one of the prediction modes. To indicate which prediction mode is used, each block needs to be marked by encoding the corresponding marker bits. That is, at the encoding end, the value of the flag bit is determined by the encoding end decision, and then the encoding is passed to the decoding end. And the decoding end determines whether the current block adopts the corresponding prediction mode or not by analyzing the mark bit.
2. direct mode and skip mode: the direct mode and the skip mode directly multiplex the motion information of the surrounding (adjacent or close blocks in time domain or space domain) 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 coded.
The direct mode and the skip mode determine whether the motion information of the current block is obtained by motion information of a neighboring block on a reference frame (corresponding to the SBTMVP mode or the TMVP mode), or is obtained by angular extrapolation of surrounding block motion vectors (corresponding to the MVAP mode), or is obtained by historical motion information (corresponding to the HMVP mode), or some default motion information, by an index (which may be referred to as a mode index) value.
3. InterPF mode: in this mode, for an Inter prediction block encoded in a direct mode (non-skip mode and non-normal Inter mode), the final prediction value is obtained by weighted averaging of pixel values of five positions, i.e., an Inter prediction pixel, left side thereof, right side thereof, upper side thereof, and lower side thereof.
4. UMVE (advanced Motion Vector Expression) mode: this mode is to shift on the basis of the motion candidates already generated, resulting in better motion candidates. One motion candidate is used as a starting point, searching is carried out from four directions of top, bottom, left and right, the offsets are 1/4, 1/2, 1, 2 and 4 pixels respectively, 2 starting points (2base), 4 offset directions (4 directions) and 5 offsets (5 offsets) are provided, and 40 motion candidates are generated in total.
Illustratively, the UMVE mode may include a conventional UMVE mode, and a mode in which UMVE is combined with an InterPF (i.e., a value of inter prediction in the InterPF mode is obtained by the UMVE mode).
5. AWP (Angular Weighted Prediction mode) mode: this mode is a mode for lifting a boundary block where two different moving objects exist. The mode firstly obtains predicted values P0 and P1 of two different motion information, and then obtains pixel-level weights based on a method similar to intra-frame angle prediction to realize accurate expression of boundaries.
Illustratively, an example of a weight is shown in FIG. 1A.
6. ETMVP (Enhanced Temporal Motion Vector Prediction mode) 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 a new matching block is obtained by shifting up, down, left and right on the basis of the matching block, as shown in fig. 1B.
7. Affine (Affine) pattern: in the mode, motion information of each sub-block of the current block is derived and obtained based on a 4-parameter or 6-parameter affine motion model. And obtaining the predicted value of the current block through motion compensation based on the motion information of each sub-block.
Illustratively, the affinity mode may include a conventional affinity mode, and an affinity _ UMVE mode combined with UVME (i.e., ambient motion information multiplexed by the affinity mode may be adjusted by a method similar to the UMVE mode).
8. Frame type (frame type): if the current frame can not refer to the information of other frames for coding, the current frame is an I frame; if the block of the current frame only allows to refer to the information of some other 1 frame (but can not exceed 1 frame) for coding, the current frame is a P frame; if the block of the current frame allows to code by simultaneously referring to the information of some other 1 frame or some 2 frame, the current frame is a B frame.
9. Sequence header information (sh): in the sequence header information, there is a flag bit that determines whether certain tool switches (methods) are allowed in the entire sequence. If the flag bit is 1, then the tool (method) is allowed to be enabled during the encoding of the sequence; otherwise, the tool (method) cannot be enabled during the encoding of the sequence.
10. Picture header (ph): in this picture header information there are flag bits that determine whether certain tool switches (methods) are allowed in the current picture. If the flag bit is 1, then the tool (method) is allowed to be enabled in the encoding process of the image; otherwise, the tool (method) cannot be enabled during the encoding of the image.
11. Rate-Distortion principle (Rate-Distortion Optimized, RDO for short): the index for evaluating the coding efficiency includes: code rate and Peak Signal to Noise Ratio (PSNR). The smaller the code rate, the larger the compression rate; the larger the PSNR, the better the reconstructed image quality. In the mode selection, the discriminant formula is essentially the comprehensive evaluation of the two.
Cost corresponding to the mode: j (mode) ═ D + λ R. Wherein D represents Distortion (Distortion), which is usually measured by using SSE (sum of mean square differences) index, wherein SSE refers to the sum of mean square differences between the reconstructed block and the source image block; λ is the Lagrangian multiplier; r is the actual number of bits required for encoding the image block in this mode, including the sum of bits required for encoding mode information, motion information, residual, etc.
When selecting the mode, if the RDO principle is used to make a comparison decision on the coding mode, the best coding performance can be ensured.
12. Intra string copy prediction (intra string copy prediction): the decoded sample is used in the same decoded picture to copy to the current sample region as a pattern of current sample predictors. The 2-dimensional shape and the number of samples of the region of replicated samples are the same as the 2-dimensional shape and the number of samples of the current sample region.
13. String vector (string vector): a two-dimensional vector for the string copy intra prediction mode having a value of a coordinate offset between a current string and a reference string, wherein the current string and the reference string are both in the current picture.
A coding unit of a serial copy intra-frame prediction mode is divided into IscPartNum parts according to the round-trip scanning order, each part is sequentially processed, and the type of the ith part is judged according to IscMatchTypeFlag [ i ] (i is 0 to IscPartNum-1). If the type of the ith part is a string, decoding according to a certain method to obtain a string vector; if the type of the ith part is an incomplete matching string and the NumMatchedPixel [ i ] is more than 0, decoding according to another method to obtain a string vector; otherwise, directly obtaining the value of each component of the unmatched pixel from the code stream.
Second, an enhanced motion information derivation method of the ETMVP mode is described below
The first step, assuming that F is an adjacent prediction block of the current prediction unit E, deriving a first stage motion vector mvFirstStage, a reference index refFirstStage and a reference direction predFirstStage of the current prediction unit;
secondly, finding a matching block from a reference frame by using a reference index refFirstStage and a reference direction predFirstStage;
in one implementation, assuming that (Xpos, Ypos) is the upper left coordinate of the current prediction unit in the picture, (x _ ctb _ pos, y _ ctb _ pos) is the upper left coordinate of the current CTU in the picture, 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 picture, and (Mx, My) is the upper left coordinate of the reference frame corresponding to refFirstStage and predFirstStage in the reference frame, then:
Mx=Clip3(((Xpos+4)>>3)<<3,x_ctb_pos,min(x_ctb_pos+128-cu_width,pic_width-cu_width))
My=Clip3(((Ypos+4)>>3)<<3,y_ctb_pos,min(y_ctb_pos+128-cu_height,pic_height-cu_height))
in an exemplary manner, the first and second electrodes are,
Figure BDA0002817963940000051
">" is the right shift operation and "< <" is the left shift operation
And min (x, y) is the smaller of x and y.
Thirdly, determining the coordinates (Px, Py) of the upper left corner of a matching block corresponding to the enhanced motion vector prediction mode according to the EtmvpCandIdx;
for example, the top-left coordinates of the etmvpcandldix +1 candidate pattern matching block in the list etmvpcandadray may be used as the top-left coordinates (Px, Py) of the matching block corresponding to the current block.
In one implementation, the list of construction of etmvpcandarrray is as follows:
a) adding an ETMVP mode 0 into the EtmvpCandAlrray, and determining (Mx, My) as the coordinates of the upper left corner of the matching block;
b) if the matching block where the (Mx, My) is located does not exceed the current CTU or the lower boundary of the image, judging whether the motion information of the positions A1 and C3 in the image 1C is the same or not and whether the motion information of the positions A2 and C4 is the same or not, if at least one group of motion information is different, adding an Etmvp mode 1 into the EtmvpCandAlrray, determining that the (Mx, My +8) is the upper left-corner coordinate of the matching block, and otherwise, performing the step C);
c) if the matching block where the (Mx, My) is located does not exceed the right boundary of the current CTU or the image, judging whether the motion information of the positions A1 and B2 in the image 1C is the same or not and whether the motion information of the positions A3 and B4 is the same or not, if at least one group of motion information is different, adding an Etmvp mode 2 into the EtmvpCandAlrray, determining that the (Mx +8, My) is the upper left-corner coordinate of the matching block, and otherwise, performing the step d);
d) if the matching block where the (Mx, My) is located does not exceed the upper boundary of the current CTU or the image, judging whether the motion information of the positions A3 and C1 in the image 1C is the same or not and whether the motion information of the positions A4 and C2 is the same or not, if at least one group of motion information is different, adding an Etmvp mode 3 into the EtmvpCandAlrray, determining the upper left corner coordinate of the matching block where the (Mx, My-8) is located, and otherwise, performing the step e);
e) if the matching block where the (Mx, My) is located does not exceed the current CTU or the left boundary of the image, judging whether the motion information of the positions A2 and B1 in the image 1C is the same or not and whether the motion information of the positions A4 and B3 is the same or not, if at least one group of motion information is different, adding an Etmvp mode 4 into the EtmvpCandAlrray, determining the upper left-corner coordinate of the (Mx-8, My), and if not, performing the step f);
f) and if the length of the EtmvpCandAlrray is less than the threshold value T, repeating the filling operation of the last mode in the EtmvpCandAlrray until the length of the EtmvpCandAlrray is T.
Illustratively, T-5.
And fourthly, determining the motion information of each sub-block of the current prediction unit according to the coordinates (Px, Py) at the upper left corner of the matched block.
In one implementation, the implementation method of the fourth step is as follows:
a) and for the current decoding unit, i is 0 to (cu _ width >3) -1, j is 0 to (cu _ height >3) -1, and (i, j) is the index of 8 × 8 subblocks in the current decoding unit, the width of the current decoding unit of cu _ width, and cu _ height is the height of the current decoding unit. The MotionArrayLX is the motion information of the sub-block inside the current decoding unit (including the motion vector mvarrayalx [ i ] [ j ], the reference index refarrayallx [ i ] [ j ], and the prediction direction PredDirArrayLX [ i ] [ j ]), and if the current block is a P picture, X is 0; if the image in which the current block is located is a B image, X is 0 or 1.
b) Judging whether the motion information of 8 x 8 sub-blocks corresponding to coordinates (Px + (i < <3) and Py + (j < <3)) in the matching block is available, if so, stretching the motion information to the first frames in List0 and List1, and assigning the first frames to motionAlrayLX [ i ] [ j ]; if not, it is scaled to the first frame in List0 and List1 with the first stage motion information mvFirstStage and assigned to MotionAlrayLX [ i ] [ j ].
Block division technology in three-dimensional video coding standard
In HEVC, a Coding Tree Unit (CTU) is recursively divided into CUs using a quadtree. It is determined at the leaf node CU level whether to use intra-coding or inter-coding. A CU may be further divided into two or four Prediction Units (PUs), and the same Prediction information is used in the same PU. After residual information is obtained after prediction is completed, a CU may be further divided into a plurality of Transform Units (TUs). For example, the current image block in this application is a PU.
However, the block partitioning technique in the newly proposed general Video Coding (VVC) is greatly changed. A mixed binary tree/ternary tree/quadtree partition structure replaces the original partition mode, cancels the concept distinction of the original CU, PU and TU and supports a more flexible partition mode of the CU. The CU may be a square or a rectangular partition. The CTU first performs the partition of the quadtree, and then the leaf nodes of the quadtree partition may further perform the partition of the binary tree and the ternary tree. As shown in fig. 2A, the CU has five partition types, which are quadtree partition, horizontal binary tree partition, vertical binary tree partition, horizontal ternary tree partition and vertical ternary tree partition, respectively, as shown in fig. 2B, a CU partition in a CTU may be any combination of the above five partition types, and different partition manners are known from the above, so that the shape of each PU is different, such as rectangle or square with different sizes. The block division referred to in this application may adopt a block division technique in VVC, may adopt a block division technique in HEVC, and may adopt a block division technique specified in other standards.
Since there are constraints on the encoding of the flag bits for each mode, a mode may be enabled only if all conditions are met, i.e., its flag bits need to be encoded. These conditions are known when the first mode (i.e., the regular merge mode) is encoded. When the previous flag bit is coded, the coding of the current mode flag bit can be skipped according to the conditions, so as to save the code rate overhead.
For example, when the direct mode is encoded, if it is known that all the remaining modes, such as UVME and AFFINE, cannot be enabled based on the current condition, the flag bit of the current direct mode may not be encoded. In this case, the decoding end can determine that all the remaining modes such as UVME and AFFINE cannot be enabled only by judging the known conditions, and therefore only the direct mode can be enabled, that is, the flag bit of the direct mode is not required to be decoded, and the flag bit can be determined to be 1.
Referring to fig. 3, a flowchart of a prediction mode decoding method according to an embodiment of the present application is shown, as shown in fig. 3, the prediction mode decoding method may include the following steps:
step S300, aiming at the current block, before the binary coding information of the mark bit of the mode to be decoded is decoded, whether the current block meets the decoding-free condition of the mark bit of the mode to be decoded is judged according to the specific information of the current block. If yes, go to step S310; otherwise, go to step S320.
Illustratively, the specific information may include a value of at least one acquired mode flag bit and/or decoding information whether at least one prediction mode is available.
In the embodiment of the application, in order to avoid that the value of the mode flag bit can only be determined by decoding the binarization encoding information of the mode flag bit, before the binarization encoding information of the mode flag bit to be decoded is decoded, whether the current block meets the decoding-free condition of the mode flag bit to be decoded or not can be judged according to the specific information of the current block.
It should be noted that, in the embodiment of the present application, the decoding-free condition refers to that the encoded information does not need to be parsed from the code stream, for example, the condition that the mode flag bit to be decoded is satisfied refers to that the encoded information of the mode flag bit to be decoded does not need to be parsed from the code stream.
The mode flag to be decoded refers to a mode flag bit whose value needs to be determined at the current time, and the mode flag bit to be decoded is a mode flag bit whose value needs to be determined in the process of determining the enabled prediction mode of the current block. The current block refers to an image block to be currently decoded.
For example, assuming that the candidate prediction modes of the current block include prediction mode a to prediction mode D, a 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 enabled prediction mode of the current block, the value of the mode flag bit 1 and the value of the mode flag bit 2 or the mode flag bit 3 need to be determined. The flag bit to be decoded may be mode flag bit 1, mode flag bit 2, or mode flag bit 3.
The decoding-free condition of the mode flag bit to be decoded refers to a condition that the value of the mode flag bit to be decoded can be determined without decoding the binarized encoded information of the mode flag bit to be decoded.
For example, the decoding-free condition of the mode flag bit to be decoded may be that none of the candidate prediction modes under one of the values of the mode flag bit to be decoded is available.
Still taking the above example as an example, for the mode flag bit 1, the decoding-free condition of the mode flag bit may be that neither prediction mode a nor prediction mode B is available, or that neither prediction mode C nor prediction mode D is available.
For example, the decoding-exempt condition of the mode flag bit to be decoded may further include that a 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 (that is, the enabled prediction mode of the current block is not a candidate prediction mode under any value of the mode flag bit to be decoded), or that a value of the mode flag bit before the mode flag bit to be decoded points to the mode flag bit to be decoded (that is, the enabled prediction mode of the current block is a candidate prediction mode under one value of the mode flag bit to be decoded), and none of the candidate prediction modes under one value of the mode flag bit to be decoded is available.
Still in the above example, if the value of the mode flag bit 1 is the first value, it indicates that neither the prediction mode a nor the prediction mode B is enabled, that is, at this time, it needs to determine whether the current block enables the prediction mode C based on the value of the mode flag bit 3; for the mode flag bit 3, the decoding-free condition of the mode flag bit 3 may include that the value of the mode flag bit 1 is the second value (at this time, the value of the mode flag bit 3 is a value for indicating that the prediction mode C is not enabled), or that the value of the mode flag bit 1 is the first value, and one of the prediction mode C or the prediction mode D is not available.
For example, if prediction mode D is not available, the value of mode flag bit 3 is a value indicating that prediction mode C is enabled.
Step S310, according to the specific information, determining that the binary value of the mode flag bit to be decoded is a first value or a second value.
In the embodiment of the present application, if the current block satisfies the decoding-free condition of the mode flag bit to be decoded, the step of decoding the binarized encoded information of the mode flag bit to be decoded may be skipped, that is, the binarized encoded information of the mode flag bit to be decoded is not decoded, but the binarized value of the mode flag bit to be decoded is determined to be the first value or the second value according to the specific information of the current block.
For example, when it is determined that none of the candidate prediction modes under the condition that the binarization value of the to-be-decoded mode flag bit is the first value is available according to the specific information, it may be determined that the binarization value of the to-be-decoded mode flag bit is the second value.
Illustratively, the first value is 0 and the second value is 1; or the first value is 1 and the second value is 0.
For ease of understanding and description, the first value is 0 and the second value is 1.
Step S320, reading the binarization encoding information of the flag bit of the mode to be decoded, decoding the encoding information, and determining that the binarization value of the flag bit of the mode to be decoded is the first value or the second value.
In the embodiment of the application, if the current block does not satisfy the decoding-free condition of the mode flag bit to be decoded, the binarization value of the mode flag bit to be decoded can be determined to be the first value or the second value in a manner of decoding the binarization encoding information of the mode flag bit to be decoded.
For example, the encoding and decoding manner of the mode flag bit to be decoded may include context-based arithmetic binary encoding and decoding or context-free binary encoding and decoding.
It should be noted that, in the embodiment of the present application, in the flow shown in fig. 3, whether the binarization encoding information of the to-be-decoded mode needs to be decoded is determined by determining whether the current block satisfies a decoding-free condition of the to-be-decoded mode flag bit. In implementation, however, it may also be determined that the binarization encoding information of the mode to be decoded needs to be decoded by setting a decoding condition and determining whether the current block satisfies the decoding condition of the flag bit of the mode to be decoded.
For example, the flow shown in fig. 3 can also be described as follows: for a current block, before the binarization coding information of a mode marking bit to be decoded is decoded, judging whether the current block meets the decoding condition of the mode marking bit to be decoded according to specific information of the current block, if so, reading the binarization coding information of the mode marking bit to be decoded, decoding the coding information, and determining the binarization value of the mode marking bit to be decoded as a first value or a second value; and if the current block does not meet the decoding condition of the mark bit of the mode to be decoded, determining the value of the mark bit of the mode to be decoded as a first value or a second value according to the specific information. The specific information includes a value of at least one acquired mode flag bit and/or decoding information whether at least one prediction mode is available.
For example, for a current block, if the current block satisfies the decoding-free condition of the flag bit of the mode to be decoded, the current block may also be described as not satisfying the decoding condition of the flag bit of the mode to be decoded;
if the current block does not satisfy the decoding-free condition of the mode flag bit to be decoded, the current block may also be described as satisfying the decoding condition of the mode flag bit to be decoded.
Therefore, in the embodiment of the present application, the description of whether the current block satisfies the decoding-free condition of the mode flag bit to be decoded may be replaced by the description of whether the current block satisfies the decoding condition of the flag bit to be decoded, and the difference between the two is that the execution flow of the branch whose determination result is yes is the execution flow of the branch whose determination result is no; the branch execution flow whose determination result is no is the branch execution flow whose determination result is yes.
It can be seen that, in the flow shown in fig. 3, before the binarization encoding information of the mode flag bit to be decoded is decoded, whether the current block satisfies the decoding-free condition of the mode flag bit to be decoded is determined based on the specific information of the current block, and when the current block satisfies the decoding-free condition of the mode flag bit to be decoded, the binarization encoding information of the mode flag bit to be decoded is not decoded, but the binarization value of the mode flag bit to be decoded is determined according to the specific information, so that the binarization value of the mode flag bit to be decoded is determined without decoding the binarization encoding information of the mode flag bit to be decoded, thereby saving encoding bits and improving encoding and decoding performance.
In some embodiments, before determining whether the current block satisfies the decoding-free condition of the mode flag bit to be decoded according to the specific information of the current block in step S300, the method may further include:
before the binary coding information of the control switch flag bit of the first target prediction mode is decoded, acquiring and judging 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, skipping the step of decoding the binaryzation coding information of the control switch mark bit of the first target prediction mode, and determining the binaryzation value of the control switch mark bit of the first target prediction mode as a first value;
if the current block does not meet the decoding-free condition of the first target prediction mode, executing the step of decoding the binary coding information of the control switch flag bit of the first target prediction mode;
and if the binary value of the control switch flag bit of the first target prediction mode is decoded to be the first value, executing the step of judging whether the current block meets the decoding-free condition of the flag bit of the mode to be decoded or not according to the specific information of the current block.
For example, in the encoding and decoding process, the candidate prediction mode of the current block is usually different when it is determined that one prediction mode is enabled or when it is determined that the prediction mode is not enabled.
For example, taking skip mode as an example, in the case that skip mode is enabled, the candidate prediction mode may include a regular skip mode; in the case where skip mode is not enabled, the candidate prediction mode does not include the regular skip mode.
For example, before determining whether the current block satisfies a decoding-free condition of a mode flag bit to be decoded according to specific information of the current block, it may be further determined whether the current block enables a first target prediction mode.
For example, if the first target prediction mode is not enabled, the binary encoding information of the mode flag bit to be decoded in step S300 does not need to be decoded.
In order to avoid that whether the current block enables the first target prediction mode can be determined only by decoding the binarization encoding information of the control switch flag bit of the first target prediction mode, before decoding the binarization encoding information of the control switch flag bit of the first target prediction mode, whether the current block meets the decoding-free condition of the first target prediction mode can be obtained and judged according to the decoding information of the current block.
If the current block meets the decoding-free condition of the mode flag bit of the first target prediction mode, the binary coding information of the control switch flag bit of the first target prediction mode does not need to be decoded, and the binary value of the control switch flag bit of the first target prediction mode is determined to be the first value.
In the application, the meaning of the decoding-free or decoding-free of any mode flag bit is that the value of the mode flag bit is directly derived without reading the binary coding information of the mode flag bit and obtaining the value of the mode flag bit through decoding. In the application, any mode flag bit needs to be decoded or decoded, and the meaning is that the value of the mode flag bit is obtained by reading the binarization encoding information of the mode flag bit from the code stream and decoding.
For example, the decoding-free condition of the first target prediction mode may include a condition that the first target prediction mode is not enabled, and the first value is a value indicating that the first target prediction mode is not enabled.
Note that, in this case, it is not necessary to decode the binarized encoded information of the mode flag bit to be decoded in step S300.
And if the current block does not meet the decoding-free condition of the first target prediction mode, decoding the binary coding 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.
If the binary value of the control switch flag bit of the decoded first target prediction mode is the second value, the first target prediction mode is determined to be started, and at this time, the binary value of the flag bit of the mode to be decoded can be determined according to the flow shown in fig. 3.
It should be noted that, if the binarization value of the control switch flag bit of the first target prediction mode is not decoded, for example, the code stream does not have the binarization encoding information of the control switch flag bit of the first target prediction mode, or the binarization value of the control switch flag bit of the first target prediction mode is decoded as the second value, it is determined that the first target prediction mode is not enabled, and in this case, the binarization encoding information of the flag bit of the mode to be decoded in step S300 does not need to be decoded.
In an example, before 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, the method may further include:
before the binary coding information of the control switch flag bit of the second target prediction mode is decoded, acquiring and judging 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, skipping the step of decoding the binaryzation coding information of the control switch flag bit of the second target prediction mode, and determining that the binaryzation value of the control switch flag bit 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, executing the step of decoding the binary coding information of the control switch flag bit of the second target prediction mode;
and if the binary value of the control switch flag bit of the second target prediction mode is decoded to be the second value, executing the step of acquiring and judging whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block.
Illustratively, there is a certain order of whether the different prediction modes are enabled.
For example, for skip mode and direct mode, when skip mode is enabled, direct mode is not enabled; in the case that skip mode is not enabled, it is only necessary to consider whether direct mode is enabled.
For example, the first target prediction mode is a prediction mode that needs to be determined whether the second target prediction mode is enabled or not if the second target prediction mode is not enabled.
In order to avoid that whether the current block enables the second target prediction mode can be determined only by decoding the binarization encoding information of the control switch flag bit of the second target prediction mode, before decoding the binarization encoding information of the control switch flag bit of the second target prediction mode, whether the current block meets the decoding-free condition of the second target prediction mode can be obtained and judged according to the decoding information of the current block.
If the current block meets the decoding-free condition of the second target prediction mode, it may not be necessary to decode the binarization encoding information of the control switch flag bit of the second target prediction mode, and determine that the binarization value of the control switch flag bit of the second target prediction mode is a value (i.e., the first value) for indicating that the second target prediction mode is not enabled, at this time, it may be determined whether to enable the first target prediction mode according to the manner described in the above embodiment.
And if the current block does not meet the decoding-free condition of the second target prediction mode, decoding the binary coding 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.
And if the binary value of the control switch flag bit of the second target prediction mode is decoded to be the second value, determining to start the second target prediction mode, and at the moment, determining not to start the first target prediction mode.
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, the code stream does not have binary encoding information of the control switch flag bit of the second target prediction mode, or the binary value of the control switch flag bit of the second target prediction mode is decoded as the second value, it is determined that the second target prediction mode is not enabled, and in this case, it is determined whether the first target prediction mode is enabled according to the manner described in the above embodiment.
In one example, the first target prediction mode is skip mode.
The at least one prediction mode includes one or more prediction modes of the candidate prediction modes when skip mode is enabled.
For example, taking the first target prediction mode as the skip mode, the candidate prediction modes when the skip mode is enabled may include at least one or more of a normal skip mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode.
The at least one prediction mode in the flow shown in fig. 3 may include one or more of the candidate prediction modes when skip mode is enabled.
In one example, when the first target prediction mode is skip mode, the decoding-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a first threshold.
Illustratively, it is considered 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 a skip mode.
In addition, there is a limit in size considering that a block enabling skip mode is generally.
For example, whether the current block satisfies the decoding-free condition of the skip mode may be determined according to the mode used by the current block and/or the size of the current block.
And if the current block uses a common intra-frame prediction mode, a block copy intra-frame prediction mode or a string copy intra-frame prediction mode, and/or the sum of the width and the height of the current block is smaller than a first threshold (which can be set according to actual requirements), determining that the current block meets the decoding-free condition of the skip mode.
In one example, the first threshold is 16.
It should be noted that, in the embodiment of the present application, if the current block does not satisfy the decoding-free condition of the first target prediction mode, it may also be determined that the current block satisfies the decoding condition of the first target prediction mode, and at this time, it may be determined whether the first target prediction mode is enabled according to another policy, for example, by decoding binary encoding information of a control switch flag bit of the first target prediction mode.
In one example, the first target prediction mode is direct mode and the second target prediction mode is skip mode.
The at least one prediction mode is one or more prediction modes in the candidate prediction modes when the direct mode is enabled.
Illustratively, 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 normal direct mode, the InterPF mode, the affinity mode, the UMVE mode, the AWP mode, and the ETMVP mode.
The at least one prediction mode in the flow shown in fig. 3 may include one or more of the candidate prediction modes when direct mode is enabled.
In one example, when the first target prediction mode is direct mode, the decoding-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is smaller than a second threshold value;
when the second target prediction mode is skip mode, the decoding-free condition of the second target prediction mode includes 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 sum of the width and the height of the current block is less than a third threshold.
Illustratively, it is considered 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 a direct mode.
Furthermore, there is a limit in size considering that blocks in which the direct mode is enabled are generally.
For example, whether the current block satisfies the decoding-free condition of the direct mode may be determined according to a mode used by the current block and/or a size of the current block.
And if the current block uses a common intra-frame prediction mode, a block copy intra-frame prediction mode or a string copy intra-frame prediction mode, and/or the sum of the width and the height of the current block is smaller than a second threshold (which can be set according to actual requirements), determining that the current block meets the decoding-free condition of the direct mode.
In one example, the second threshold is 16.
Illustratively, it is considered 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 a skip mode.
Furthermore, there is a limit in size considering that a block in which skip mode is enabled is generally.
For example, whether the current block satisfies the decoding-free condition of the skip mode may be determined according to the mode used by the current block and/or the size of the current block.
And if the current block uses a common intra-frame prediction mode, a block copy intra-frame prediction mode or a string copy intra-frame prediction mode, and/or the sum of the width and the height of the current block is smaller than a third threshold (which can be set according to actual requirements), determining that the current block meets the decoding-free condition of the skip mode.
In one example, the third threshold is 16.
In some embodiments, the decoding information that is available or not for any of the at least one prediction mode includes one or more of switch state information, size information of the current block, and frame type information.
For example, considering whether a prediction mode is available is generally limited by one or more of a switch (e.g., an upper switch such as a sequence level switch or an image level switch), a block size, and a frame type, when determining whether a prediction mode is available, it may be determined according to one or more of a size limitation condition, a frame type limitation condition, and a switch limitation condition of the corresponding mode.
Thus, for any prediction mode, whether it is available may be determined based on one or more of the corresponding switch state information, size information of the current block, and frame type information.
In one example, for any of the at least one prediction mode, determining whether the decoding information is available based on whether the prediction mode is available comprises:
determining whether the current block satisfies a constraint condition that the prediction mode is allowed to be enabled based on decoding information whether the prediction mode is available;
if yes, determining that the prediction mode is available; otherwise, the prediction mode is determined to be unavailable.
Example one, when the prediction mode is the UMVE mode, the limiting condition that it allows enabling includes that the sequence level switch of the UMVE mode is in an open state.
For example, for the UMVE mode, whether it meets the limitation of enabling may be determined according to the switch limitation.
If the sequence level switch of the UMVE mode is in an open state, determining that the limitation condition that the UMVE mode is allowed to be started is met, namely the UMVE mode is available; otherwise, it is determined that the restriction condition that the UMVE mode is allowed to be enabled is not satisfied, i.e., the UMVE mode is not available.
Example two, when the prediction mode is the AWP mode, the limitation conditions that the prediction mode is allowed to be enabled include one or more of the following:
the sequence level switch of the AWP mode is in an open state, the product of the width and the height of the current block is larger than or equal to a first size threshold value, the width of the current block is smaller than or equal to a first width threshold value, the height of the current block is smaller than or equal to a first height threshold value, and the frame type of the frame to which the current block belongs is a B frame.
For example, for the AWP mode, whether it satisfies the restriction allowing the enablement may be determined according to the switch restriction, the size restriction, and the frame type restriction.
If a sequence level switch of the AWP mode is in an open state, the product of the width and the height of the current block is greater than or equal to a first size threshold value, the width of the current block is less than or equal to a first width threshold value, the height of the current block is less than or equal to a first height threshold value, and the type of the frame to which the current block belongs is a B frame, determining that a limiting condition that the AWP mode is allowed to be enabled is met, namely the AWP mode is available; otherwise, that is, any one of the above conditions is not satisfied, for example, the sequence level switch of the AWP mode is in an off state, or the product of the width and the height of the current block is smaller than the first size threshold, and the like, it is determined that the restriction condition that the AWP mode is allowed to be enabled is not satisfied, that is, the AWP mode is not available.
It should be noted that, in some examples, the "belonging frame type is B frame" in the above limitation of enabling may also be replaced by "belonging SLICE type is SLICE _ B".
Example three, when the prediction mode is the ETMVP mode, the limitation conditions allowed to be enabled include one or more of the following:
the sequence level switch of the ETMVP mode is in an open state, the width of the current block is greater than or equal to a second width threshold value, and the height of the current block is greater than or equal to a second height threshold value.
For example, for the ETMVP mode, whether it satisfies the restriction condition allowing the enablement may be determined according to the switch restriction condition and the size restriction condition.
If the sequence level switch of the ETMVP mode is in an open state, the width of the current block is greater than or equal to a second width threshold value, and the height of the current block is greater than or equal to a second height threshold value, determining that a limiting condition that the ETMVP mode is allowed to be started is met, namely the ETMVP mode is available; otherwise, that is, any one of the above conditions is not satisfied, for example, the sequence level switch of the ETMVP mode is in an off state, or the width of the current block is smaller than the second width threshold, and the like, it is determined that the limitation condition that the ETMVP mode is allowed to be enabled is not satisfied, that is, the ETMVP mode is not available.
Example four, when the prediction mode is the affinity mode, the limitation conditions allowed to be enabled include one or more of the following conditions:
the sequence level switch of the Affinine mode is in an open state, the width of the current block is greater than or equal to a third width threshold value, and the height of the current block is greater than or equal to a third height threshold value.
For example, for the affinity mode, whether the switch limit condition and the size limit condition satisfy the limit condition allowing the activation may be determined.
If the sequence level switch of the Affinine mode is in an open state, the width of the current block is greater than or equal to a third width threshold value, and the height of the current block is greater than or equal to a third height threshold value, determining that the limitation condition that the Affinine mode is allowed to be started is met, namely the Affinine mode is available; otherwise, that is, any one of the above conditions is not satisfied, for example, if the sequence level switch of the affinity mode is in the off state, or the width of the current block is smaller than the third width threshold, it is determined that the restriction condition that the affinity mode is allowed to be enabled is not satisfied, that is, the affinity mode is unavailable.
Example five, when the prediction mode is the inter pf mode, the allowable enabling constraints include one or more of the following;
the sequence level switch of the InterPF mode is in an open state, the product of the width and the height of the current block is greater than or equal to a second size threshold value, the width of the current block is less than or equal to a fourth width threshold value, and the height of the current block is less than or equal to a fourth height threshold value.
For example, for the interprof mode, whether the limitation condition for enabling is met or not can be determined according to the switch limitation condition and the size limitation condition.
If the sequence level switch of the InterPF mode is in an open state, the product of the width and the height of the current block is greater than or equal to a second size threshold value, the current block is less than or equal to a fourth width threshold value, and the height of the current block is less than or equal to a fourth height threshold value, determining that the limiting condition of enabling the InterPF mode is met, namely the InterPF mode is available; otherwise, that is, any one of the above conditions is not satisfied, for example, if the sequence level switch of the inter pf mode is in an off state, or the width of the current block is greater than the fourth width threshold, it is determined that the restriction condition that the affinity mode is allowed to be enabled is not satisfied, that is, the inter pf mode is not available.
It should be noted that, when the constraint condition that a prediction mode (e.g., an AWP mode) is allowed to be enabled includes a plurality of conditions, and when any one of the plurality of conditions is not satisfied, it is understood that the disabling condition of the prediction mode is satisfied, that is, when any one of the plurality of conditions is not satisfied, it is determined that the disabling condition of the prediction mode is satisfied, and the prediction mode is not usable.
In addition, the condition "equal to" in the above condition, for example, the product of the width and the height of the current block is equal to the first size threshold, may be as the limiting condition for allowing the enabling described in the above embodiment, and in practical applications, may also be as the disabling condition, for example, in the case that the product of the width and the height of the current block is equal to the first size threshold, it may also be determined that the disabling condition of the AWP mode is satisfied, and it is determined that the AWP mode is not enabled.
Referring to fig. 4, a flowchart of a prediction mode encoding method according to an embodiment of the present application is shown, and as shown in fig. 4, the prediction mode encoding method may include the following steps:
step S400, aiming at the current block, before the binary coding information of the mode marking bit to be coded is written into the code stream, whether the current block meets the coding-free condition of the mode marking bit to be coded is judged. If yes, go to step S410; otherwise, go to step S420.
And S410, skipping the step of writing the binary coding information of the mode marking bit to be coded into the code stream.
And step S420, writing the binary coding information of the mode marking bit to be coded into a code stream.
For example, the implementation of the flow shown in fig. 4 may refer to the related description in the flow shown in fig. 3, and details of the embodiment of the present application are not repeated here.
The same as the decoding end process, in the encoding end process, whether the current block meets the encoding-free condition of the mode marking bit to be encoded or not can be replaced by whether the current block meets the encoding condition of the mode marking bit to be encoded or not, and the difference between the two processes is that the execution process of the branch with the positive judgment result is the execution process of the branch with the negative judgment result; the branch execution flow whose determination result is no is the branch execution flow whose determination result is yes.
For example, the flow shown in fig. 4 may be described as: and for the current block, before writing the binary coding information of the mode marking bit to be coded into the code stream, judging whether the current block meets the coding condition of the mode marking bit to be coded. If the current block meets the coding condition of the mode marking bit to be coded, writing the binary coding information of the mode marking bit to be coded into a code stream; and if the current block does not meet the coding condition of the mark bit of the mode to be coded, skipping the step of writing the binary coding information of the mark bit of the mode to be coded into the code stream.
In a possible implementation manner, before determining whether the current block satisfies the coding-exempting condition of the mode flag bit to be coded in step S400, the method may further include:
before the binary coding information of the control switch flag bit of the first target prediction mode is written into a code stream, judging whether the current block meets the decoding-free condition of the first target prediction mode;
if the current block meets the decoding-free condition of the first target prediction mode, skipping the step of writing the binary coding information of the control switch flag bit of the first target prediction mode into the code stream, and determining 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, executing a step of writing the binary coding information of the control switch flag bit of the first target prediction mode into a code stream;
and if the binary value of the control switch flag bit of the first target prediction mode is the second value, determining to execute a step of judging whether the current block meets the coding-free condition of the flag bit of the mode to be coded.
In a possible implementation manner, before the determining whether the current block satisfies the decoding-free condition of the first target prediction mode, the method further includes:
before the binary coding information of the control switch flag bit of the second target prediction mode is written into the code stream, judging whether the current block meets the decoding-free condition of the second target prediction mode;
if the current block meets the decoding-free condition of the second target prediction mode, skipping the step of writing the binary coding information of the control switch flag bit of the second target prediction mode into the code stream, and determining that the binary value of the control switch flag bit 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, executing a step of writing the binary coding information of the control switch flag bit of the second target prediction mode into the code stream;
and if the binary value of the control switch flag bit of the second target prediction mode is the second value, determining to execute the step of judging whether the current block meets the forbidden condition of the first target prediction mode.
In one possible implementation, the first target prediction mode is a skip mode;
the at least one prediction mode comprises one or more prediction modes in candidate prediction modes when the skip mode is enabled;
the candidate prediction modes when skip mode is enabled at least include one or more of a regular skip mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode.
In one possible implementation, the decoding-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a first threshold.
In one possible implementation, the first threshold is 16.
In a possible implementation manner, the first target prediction mode is a direct mode, and the second target prediction mode is a skip mode;
the at least one prediction mode is one or more prediction modes in candidate prediction modes when the direct mode is enabled;
the candidate prediction modes when the direct mode is enabled at least comprise one or more of a conventional direct mode, an InterPF mode, an affinity mode, a UMVE mode, an AWP mode and an ETMVP mode.
In one possible implementation, the decoding-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is smaller than a second threshold value;
the decoding-free condition of the second target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a third threshold.
In one possible implementation, the second threshold is 16, and/or the third threshold is 16.
In one possible implementation, for any one of the at least one prediction mode, the decoding information that is available or not includes one or more of switch state information, size information of the current block, and frame type information.
In one possible implementation, for any prediction mode of the at least one prediction mode, determining whether the prediction mode is available based on the decoding information whether the prediction mode is available comprises:
determining whether the current block satisfies a constraint condition that the prediction mode is allowed to be enabled based on decoding information whether the prediction mode is available;
if yes, determining that the prediction mode is available; otherwise, determining that the prediction mode is unavailable;
when the prediction mode is the UMVE mode, the limitation condition for allowing the activation comprises that a sequence level switch of the UMVE mode is in an open state;
when the prediction mode is an AWP mode, the limitation conditions allowing the enabling include one or more of the following:
the sequence level switch of the AWP mode is in an open state, the product of the width and the height of the current block is larger than or equal to a first size threshold value, the width of the current block is smaller than or equal to a first width threshold value, the height of the current block is smaller than or equal to a first height threshold value, and the type of the SLICE to which the current block belongs is SLICE _ B;
when the prediction mode is ETMVP mode, the allowable constraints include one or more of the following:
the sequence level switch of the ETMVP mode is in an open state, the width of the current block is greater than or equal to a second width threshold value, and the height of the current block is greater than or equal to a second height threshold value;
when the prediction mode is the affinity mode, the limitation conditions allowed to be enabled include one or more of the following:
the sequence level switch comprising the Affinine mode is in an open state, the width of the current block is greater than or equal to a third width threshold value, and the height of the current block is greater than or equal to a third height threshold value;
when the prediction mode is the inter pf mode, the allowable enabling constraints include one or more of the following;
the sequence level switch of the InterPF mode is in an open state, the product of the width and the height of the current block is greater than or equal to a second size threshold value, the width of the current block is less than or equal to a fourth width threshold value, and the height of the current block is less than or equal to a fourth height threshold value.
It should be noted that the encoding process corresponds to the decoding process, and specific implementation of each embodiment in the encoding process may refer to relevant descriptions in the decoding process, which is not described herein again in this embodiment of the present application.
In order 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 are described below with reference to specific embodiments.
In order to save the overhead of coding the marker bits, at present, each marker bit is often coded with some constraints, and the coding of the corresponding marker bit is performed only when some constraints are met. For merge/skip mode, the restriction of flag bit encoding for 5 modes is as follows:
TABLE 1 constraints for modes available in a current block
Figure BDA0002817963940000181
Analysis shows that the method still has redundancy: since there are constraints on the encoding of the flag bit for each prediction mode (i.e., the control switch flag bit described above), a prediction mode may be enabled only if all constraints are met, i.e., its flag bit needs to be encoded. These constraints are determined when the first prediction mode, i.e. regular merge, is coded. When the previous flag bit is coded, the coding of the flag bit of the current prediction mode can be skipped according to the limiting conditions, so as to save the code rate overhead.
For example, when the direct mode is coded, if it is known based on the current condition that all the remaining prediction modes, such as the UVME mode and the Affine mode, cannot be enabled, the flag bit of the current direct mode may not be coded. In this case, the decoding end can determine that all the remaining prediction modes, such as the UVME mode and the Affine mode, cannot be enabled only by judging the known conditions, and therefore, 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.
The embodiment of the present application aims to provide a new binarization method to reduce the average code length, and simultaneously, the following redundancy removal methods are combined to save the coding bit overhead of the mode flag bits:
if the current prediction mode has N sub-prediction modes, the current prediction mode only allows one sub-mode to exist, and the coding of the mode marking bits is sequentially coded according to the appointed sequence. And when the mark bit of the current sub-mode is coded, determining the number of the sub-modes which can be started subsequently based on the current condition, and if the number is 0, the mark bit of the current sub-mode does not need to be coded (the current sub-mode is always started).
Illustratively, for prediction modes with a higher probability of use, the mode flag bits are shorter codewords, and for prediction modes with a lower probability of use, the mode flag bits are longer codewords.
In addition, when the current prediction mode is analyzed, the code stream is required to be read to analyze the mode mark bit based on the limit condition or the forbidden condition allowed to be started by the prediction mode, or the value marked by the mode is directly obtained through derivation.
The following describes an implementation of the prediction mode codec with reference to a specific embodiment.
Example one
Prediction mode decoding procedure:
judging whether the current mode flag bit needs to be decoded or not for the current block, if not, deducing to obtain the value of the current mode flag bit, such as 1 or 0; if necessary, reading the code stream, and decoding to obtain the value of the current mode flag bit as 1 or 0.
Example two
Prediction mode encoding procedure:
judging whether the current mode flag bit code stream coding is needed or not for the current block, and skipping the step of writing the coding information of the current mode flag bit into the code stream if the current mode flag bit code stream coding is not needed; if the current mode flag bit is needed, the current mode flag bit is coded, and the coding information is written into a code stream.
Illustratively, the above-mentioned encoding and decoding method for the mode flag bit includes context-based arithmetic binary encoding and decoding or context-free binary encoding and decoding.
EXAMPLE III
Decoding procedure of mode flag bit (skip _ flag) of skip mode:
skip mode flag bit skip _ flag: and (4) binary variables. A value of '1' indicates that the current coding unit enables the skip mode; a value of '0' indicates that skip mode is not enabled.
Illustratively, if no skip _ flag exists in the bitstream, the value of skip _ flag is equal to 0.
Illustratively, the skip mode refers to skip residual coding, that is, when the skip _ flag is 1, coding and decoding of the residual are not required (for example, processes of inverse transformation, inverse quantization, decoding and the like of the residual at a decoding end are not required, and only a predicted value is required to be obtained).
If skip _ flag is 1, the InterPF mode cannot be enabled.
Modes 3.1,
If the current block uses normal intra prediction, block copy intra prediction or string copy intra prediction (that is, the skip mode disabling condition is satisfied), it is not necessary to decode the coding information of the skip _ flag, and it is determined that the value of the skip _ flag is equal to 0 (that is, the first value).
Otherwise, decoding the coding information of the skip _ flag to determine the value of the skip _ flag.
Modes 3.2,
If the current block uses normal intra prediction or block copy intra prediction or string copy intra prediction, or if the width of the current block is higher than the threshold WH1 (i.e., the first threshold) or lower than the threshold WH1 (i.e., the disable condition of skip mode is satisfied), it is not necessary to decode the encoded information of skip _ flag and it is determined that the value of skip _ flag is equal to 0 (i.e., the first value).
Otherwise, decoding the coding information of the skip _ flag to determine the value of the skip _ flag.
Exemplary, pattern 3.2 has a WH1 of 16.
The following describes a prediction mode decoding procedure for the case where the value of skip _ flag is 1, with reference to an embodiment.
Example four
Assuming that the mode flag bits (which may also be referred to as mode index information) to be determined to take values include umve _ awp _ etmvp _ flag, affine _ flag, etmvp _ flag, and aw _ flag as examples, the correspondence between the values of the mode flag bits and the enablement of the prediction mode is shown in table 4.1:
TABLE 4.1
Figure BDA0002817963940000201
Its corresponding binary tree diagram may be as shown in fig. 5A.
Illustratively, for umve _ awp _ etmvp _ flag, affine _ flag, etmvp _ flag, and awp _ flag, in the case that the conditions shown in table 4.2 are satisfied, the coding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
Illustratively, the "satisfied condition" described in table 4.2 is a decoding condition of the corresponding mode flag bit, and when the condition is not satisfied, it may be referred to that the current block satisfies the decoding-free condition of the corresponding mode flag bit.
For example, when the condition UMVEAvailable | | AWPAvailable | | ETMVPAvailable is not satisfied, that is, UMVEAvailable is 0, AWPAvailable is 0, and ETMVPAvailable is 0, it is determined that the current block satisfies the decoding-free condition of the flag bit umve _ awp _ etmvp _ flag, and at this time, it is not necessary to decode the encoding information of umve _ awp _ flag, and it may be determined that the value of umve _ awp _ flag is 0.
Illustratively, "|" represents a condition "or"; "& &" represents the condition "and" (may also be referred to as "and"); UMVEAvailable is 0 to indicate that the UMVE mode is not available, UMVEAvailable is 1 to indicate that the UMVE mode is available, and other modes are the same.
TABLE 4.2
Figure BDA0002817963940000211
Illustratively, the constraints that each prediction mode is allowed to enable are as follows:
4.1、UMVEAvailable=sh_UmveEnableFlag
sh _ UmveEnablFlag is a sequence level switch in the UMVE mode. When a sequence level switch of the UMVE mode is in an open state, the value of sh _ UmveEnablFlag is 1; when the sequence level switch of the UMVE mode is in a closed state, the value of sh _ UmveEnablFlag is 0.
When the sh _ UmveEnablFlag value is 1, namely the limiting condition that the UMVE mode is allowed to be started is met, the UMVEAvailable value is 1, and the UMVE mode is available;
when the sh _ UmveEnableFlag value is 0, that is, the restriction condition that the UMVE mode is allowed to be enabled is not satisfied, the UMVEAvailable value is 0, and the UMVE mode is not available.
4.2, the AWPAvailable ═ sh _ awwpenableflag & (width × height >: TH _ SIZE1) & (width ═ TH _ W1) & (height ═ TH _ H1) & & current frame type is B frame type
sh _ AfpEnablFlag is a sequential switch in an AWP mode, and when the sequential switch in the AWP mode is in an open state, the value of sh _ AfpEnablFlag is 1; when a sequential level switch in an AWP mode is in an off state, the value of sh _ AfpEnablFlag is 0;
when the product of the width and the 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) takes a value of 1; when the product of the width and the height of the current block is smaller than TH _ SIZE1, (width \ ═ TH _ SIZE1) takes a value of 0;
when the width of the current block is less than or equal to TH _ W1 (i.e., the first width threshold), the value (width ═ TH _ W1) is 1; when the width of the current block is greater than TH _ W1, (width < ═ TH _ W1) takes a value of 0;
when the height of the current block is less than or equal to TH _ H1 (i.e., the first height threshold), height < ═ TH _ H1) takes a value of 1; when the height of the current block is greater than TH _ H1, (height < ═ TH _ H1) takes the value 0;
when the frame to which the current block belongs is a B frame, the current frame type is that the value of the B frame is 1; and when the frame type of the frame to which the current block belongs is not the B frame, the current frame type is that the B frame takes the value of 0.
When sh _ awwpenableflag, (width ═ TH _ SIZE1), (width ═ TH _ W1), (height ═ TH _ H1) and the type of SLICE to which the current block belongs are not both SLICE _ B values of 1, that is, the restriction condition that the AWP mode allows enabling is satisfied, the AWPAvailable value is 1, and the AWP mode is available;
when sh _ awwpenableflag, (width > ═ TH _ SIZE1), (width < ═ TH _ W1), (height < ═ TH _ H1) and the type of SLICE to which the current block belongs are not any value of SLICE _ B being 0, that is, the restriction condition for enabling the AWP mode is not satisfied, the AWPAvailable value is 0, and the AWP mode is not available.
Illustratively, TH _ SIZE1 takes on a value of 64, TH _ W1 takes on a value of 64, and TH _ H1 takes on a value of 64.
4.3、ETMVPAvailable=sh_EtmvpEnableFlag&&(width>=TH_W2)&&(height>=TH_H2)
sh _ EtmvpEnableFlag is a sequence level switch of the ETMVP mode, and when the sequence level switch of the ETMVP mode is in an open state, the value of sh _ EtmvpEnableFlag is 1; when the sequence level switch of the ETMVP mode is in a closed state, the value of sh _ EtmvpEnableFlag is 0;
when the width of the current block is greater than or equal to TH _ W2 (i.e., the second width threshold), the value (width > -TH _ W2) is 1; when the width of the current block is less than TH _ W2, (width > ═ TH _ W2) takes a value of 0;
when the height of the current block is greater than or equal to TH _ H2 (i.e., the second height threshold), height > -TH _ H2 takes a value of 1; when the height of the current block is less than TH _ H2, (height > ═ TH _ H2) takes a value of 0.
When the sh _ EtmvpEnableFlag, (width > ═ TH _ W2) and (height > ═ TH _ H2) take values of 1, namely the limiting condition that the ETMVP mode is allowed to be started is met, the ETMVPAvailable takes a value of 1, and the ETMVP mode is available;
when any one of sh _ EtmvpEnableFlag, (width > ═ TH _ W2) and (height > ═ TH _ H2) takes a value of 0, that is, when the limitation condition that the ETMVP mode is allowed to be enabled is not satisfied, ETMVPAvailable takes a value of 0, and the ETMVP mode is not available.
Illustratively, TH _ W2 takes on a value of 8 and TH _ H2 takes on a value of 8.
4.4、AffineAvailable=sh_AffineEnableFlag&&(width>=TH_W3)&&(height>=TH_H3)
sh _ AffiniEnablFlag is a sequence level switch of the Affinine mode, and when the sequence level switch of the Affinine mode is in an open state, the value of sh _ AffiniEnablFlag is 1; when the sequence level switch of the Affinine mode is in a closed state, the value of sh _ AffiniEnablFlag is 0;
when the width of the current block is greater than or equal to TH _ W3 (i.e., the third width threshold), the value (width > -TH _ W3) is 1; when the width of the current block is less than TH _ W3, (width > ═ TH _ W3) takes a value of 0;
when the height of the current block is greater than or equal to TH _ H3 (i.e., the third height threshold), the value (height > -TH _ H3) is 1; when the height of the current block is less than TH _ H3, (height > ═ TH _ H3) takes a value of 0.
When the values of sh _ affineenabled flag, (width > ═ TH _ W3) and (height > ═ TH _ H3) are all 1, that is, when the restriction condition that the Affine mode allows to be started is met, the value of AffineAvailable is 1, and the Affine mode is available;
when any one of the values of sh _ affineenabled flag, (width > ═ TH _ W3) and (height > ═ TH _ H3) is 0, that is, when the restriction condition that the Affine mode allows activation is not satisfied, the value of AffineAvailable is 0, and the Affine mode is not available.
Illustratively, TH _ W3 takes on a value of 16 and TH _ H3 takes on a value of 16.
For the binary tree diagram shown in fig. 5A, the first value is 0, and the second value is 1.
When the value of UMVE _ AWP _ ETMVP _ flag is determined, the at least one prediction mode may be a normal Skip mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the encoded information of the UMVE _ AWP _ ETMVP _ flag (i.e., the flag bit to be decoded is UMVE _ AWP _ ETMVP _ flag), some decoding information of the current block may be obtained, and according to some obtained decoding information and the above-mentioned restriction conditions for enabling the UMVE mode, AWP mode and ETMVP mode, it is determined whether the current block does not satisfy the restriction conditions for enabling the UMVE mode, AWP mode and ETMVP mode (i.e., the decoding-free condition of the UMVE _ AWP _ ETMVP _ flag is satisfied), and it may also be understood as obtaining some specific information of the current block, which is used to determine whether the current block is available in the UMVE mode, AWP mode and ETMVP mode. If the current block in the UMVE mode, the AWP mode and the ETMVP mode is unavailable, skipping the step of decoding the encoding information of the UMVE _ AWP _ ETMVP _ flag, and directly deducing to obtain the value of the UMVE _ AWP _ ETMVP _ flag as 0; if any prediction mode of the UMVE mode, the AWP mode and the ETMVP mode is available, decoding the encoded information of the UMVE _ AWP _ ETMVP _ flag to determine whether the value of the UMVE _ AWP _ ETMVP _ flag is 0 or 1.
If the value of umve _ awp _ etmvp _ flag is 0, determining that a conventional skip mode or an Affinie mode needs to be started, and then determining the value of Affine _ flag.
When the value of Affine _ flag (namely the mode to be decoded is marked as Affine _ flag) is determined, at least one prediction mode is a conventional skip mode and an Affinine mode, and before the coding information of the Affine _ flag is decoded, whether a current block does not meet the limitation condition of the Affinine mode allowed to be enabled or not can be determined according to the obtained decoding information and the limitation condition of the Affinine mode allowed to be enabled; if yes, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 0; otherwise, decoding the encoding information of the affine _ flag to determine whether the value of the affine _ flag is 0 or 1.
If the value of affine _ flag is 0, determining that the current block enables a conventional skip mode; and if the value of Affine _ flag is 1, determining that the current block enables an affinity mode.
If the umve _ awp _ etmvp _ flag value is 1, the value of the etmvp _ flag needs to be determined.
When determining the value of ETMVP _ flag, the at least one prediction mode may be a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the coded information of the ETMVP _ flag, whether the current block does not meet the limitation condition of the ETMVP mode allowed activation can be determined according to the obtained decoded information and the limitation condition of the ETMVP mode allowed activation; if yes, skipping the step of decoding the coded information of the etmvp _ flag, and directly deducing to obtain the value of the etmvp _ flag as 0; otherwise, decoding the coded information of the etmvp _ flag to determine whether the value of the etmvp _ flag is 0 or 1.
And if the value of the ETMVP _ flag is 1, determining that the current block enables an ETMVP mode.
If the value of the etmvp _ flag is 0, determining that the current block enables a UMVE mode or an AWP mode, and at the moment, determining AWP the value of the flag.
When the value of AWP _ flag is determined, at least one of the prediction modes is a UMVE mode and an AWP mode. Before the AWP _ flag coding information is decoded, whether the current block does not meet the limit condition of the AWP mode permission enabling can be determined according to the obtained decoding information and the limit condition of the AWP mode permission enabling; if yes, skipping the step of decoding the awp _ flag coding information, and directly deducing to obtain a value of awp _ flag as 0; otherwise, the encoded information of awp _ flag is decoded to determine whether the value of awp _ flag is 0 or 1.
If the value of awp _ flag is 0, determining that the current block enables the UMVE mode; and if the value of AWP _ flag is 1, determining that the current block enables the AWP mode.
Illustratively, the syntax logic for the mode flag bit decoding described above is as follows:
Figure BDA0002817963940000241
based on the syntax logic, when the skip _ flag value is 1, if at least one of sh _ UmveEnableFlag, sh _ awbleflag & (width > ═ 8) & (height > ═ 8) & (width < = 64) & (height > & (height < ═ 64) & (PictureType ═ 2), and sh _ etmvpEnableflag & (width > - & (8) & (height >) 8) is taken as 1, that is, the current block satisfies the restriction condition that any one of the UMVE mode, the AWP mode, and the ETMVP mode is allowed to be enabled, the coding information of the skip _ AWP _ mvp _ flag needs to be decoded.
For example, the PictureType of 2 indicates that the frame type of the image frame to which the current block belongs is a B frame.
If UMVE _ AWP _ ETMVP _ flag, sh _ etmvpenameflag & (width > -8) & (height > -8), sh _ UmveEnableFlag | (sh _ AwpEnableFlag & (width &) 64) & (width < (64) & (height < (64) & (PictureType ═ 2)) all take values of 1, i.e., the value of UMVE _ AWP _ ETMVP _ flag is 1, and the restriction condition that the ETMVP mode is allowed to be enabled is satisfied, and the current block satisfies the enable condition of any one of the UMVE mode and the AWP mode, the flag coding information of mvp _ flag needs to be decoded.
If umve _ awp _ etmvp _ flag,! The values of etmvp _ flag and (sh _ UmveEnableFlag | (sh _ AwpEnableFlag & (width > ═ 8) & & (height > = 8) & & (width & & & (width & &) 64& (height &) 64) & (PictureType ═ 2)) are all 1, i.e., UMVE _ AWP _ etmvp _ flag is 1, and the current block satisfies the restriction condition that any one of the UMVE mode and the AWP mode is allowed to be enabled, the coding information of AWP _ flag needs to be decoded.
If! The values of the umve _ awp _ etmvp _ flag and the sh _ AffineEnableFlag & (width > ═ 16) & & (height > = 16) are all 1, that is, the value of the umve _ awp _ etmvp _ flag is 0, and the current block satisfies the restriction condition that the Affine mode is allowed to be enabled, the coded information of the Affine _ flag needs to be decoded.
For example, in the syntax logic, the content in the "if ()" above each mode flag bit is the decoding condition of the mode flag bit, and if the current block does not satisfy the condition, it can be determined that the current block satisfies the decoding-free condition of the mode flag bit.
EXAMPLE five
Assuming that the mode flag bits to be determined include umve _ awp _ etmvp _ flag, affine _ flag, umve _ flag, and awp _ flag as an example, the correspondence between the value of each mode flag bit and the enabling of the prediction mode is shown in table 5.1:
TABLE 5.1
Figure BDA0002817963940000251
Its corresponding binary tree diagram may be as shown in fig. 5B.
Illustratively, for umve _ awp _ etmvp _ flag, affine _ flag, umve _ flag, and awp _ flag, in case that the conditions shown in table 5.2 are satisfied, the coding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
TABLE 5.2
Figure BDA0002817963940000252
Figure BDA0002817963940000261
For an exemplary limitation that each prediction mode is allowed to be enabled, see the related description in the fourth embodiment.
For example, syntax logic of the mode flag bit decoding may be similar to that implemented in the fourth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5B, the first value is 0, and the second value is 1.
When the value of UMVE _ AWP _ ETMVP _ flag is determined, the at least one prediction mode may be a normal Skip mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the encoded information of UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block may be obtained, and according to some obtained decoding information and the above-mentioned restriction conditions for enabling the UMVE mode, AWP mode and ETMVP mode, it is determined whether the current block does not satisfy the restriction conditions for enabling the UMVE mode, AWP mode and ETMVP mode, or may be understood as obtaining some specific information of the current block, which is used to determine whether the UMVE mode, AWP mode and ETMVP mode is available in the current block. If the UMVE mode, the AWP mode and the ETMVP mode are unavailable, skipping the step of decoding the encoding information of the UMVE _ AWP _ ETMVP _ flag, and directly deducing to obtain a value of the UMVE _ AWP _ ETMVP _ flag as 0; if any prediction mode of the UMVE mode, the AWP mode and the ETMVP mode is available, decoding the encoded information of the UMVE _ AWP _ ETMVP _ flag to determine whether the value of the UMVE _ AWP _ ETMVP _ flag is 0 or 1.
If the value of umve _ awp _ etmvp _ flag is 0, determining that a conventional skip mode or an Affinie mode needs to be started, and then determining the value of Affine _ flag.
When the value of Affine _ flag is determined, at least one prediction mode can be a conventional skip mode and an Affine mode, and before decoding the encoding information of the Affine _ flag, whether the current block does not meet the limitation condition that the Affine mode is allowed to be enabled can be determined according to the obtained decoding information and the limitation condition that the Affine mode is allowed to be enabled; if yes, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 0; otherwise, decoding the encoding information of the affine _ flag to determine whether the value of the affine _ flag is 0 or 1.
If the value of affine _ flag is 0, determining that the current block enables a conventional skip mode; and if the value of Affine _ flag is 1, determining that the current block enables an affinity mode.
If the value of umve _ awp _ etmvp _ flag is 1, the value of umve _ flag needs to be determined.
When the value of UMVE _ flag is determined, the at least one prediction mode may be an ETMVP mode, an AWP mode, and a UMVE mode. Before decoding the UMVE _ flag coding information, determining whether the current block does not meet the UMVE mode enabled limiting condition according to the obtained decoding information and the UMVE mode enabled limiting condition; if yes, skipping the step of decoding the encoding information of the umve _ flag, and directly deducing to obtain the value of the umve _ flag as 0; otherwise, decoding the coded information of the umve _ flag to determine whether the value of the umve _ flag is 0 or 1.
And if the value of UMVE _ flag is 1, determining that the current block enables the UMVE mode.
If the value of umve _ flag is 0, determining that the current block enables an ETMVP mode or an AWP mode, and at this time, determining AWP the value of the _ flag.
When the value of AWP _ flag is determined, at least one prediction mode is an ETMVP mode and an AWP mode. Before the AWP _ flag coding information is decoded, whether the current block does not meet the limit condition of the AWP mode permission enabling can be determined according to the obtained decoding information and the limit condition of the AWP mode permission enabling; if yes, skipping the step of decoding the awp _ flag coding information, and directly deducing to obtain a value of awp _ flag as 0; otherwise, the encoded information of awp _ flag is decoded to determine whether the value of awp _ flag is 0 or 1.
If the value of awp _ flag is 0, determining that the current block enables an ETMVP mode; if AWP _ flag takes a value of 1, it is determined that the current block enables the AWP mode.
Example six
Assuming that the mode flag bits to be determined include a regular _ skip _ flag, a umve _ flag, an aw _ flag, and an affine _ flag as an example, the corresponding relationship between the value of each mode flag bit and the enabling of the prediction mode is shown in table 6.1:
TABLE 6.1
Figure BDA0002817963940000271
Its corresponding binary tree diagram may be as shown in fig. 5C.
Illustratively, for umve _ awp _ etmvp _ flag, affine _ flag, etmvp _ flag, and awp _ flag, in the case where the conditions shown in table 6.2 are satisfied, the coding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
Illustratively, the "satisfied condition" described in table 6.2 is a decoding condition for the corresponding mode flag bit, and when the condition is not satisfied, it may be referred to that the current block satisfies the decoding-free condition for the corresponding mode flag bit.
TABLE 6.2
Figure BDA0002817963940000281
For an exemplary limitation that each prediction mode is allowed to be enabled, see the related description in the fourth embodiment.
For example, syntax logic of the mode flag bit decoding may be similar to that implemented in the fourth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5C, the first value is 0, and the second value is 1.
When the value of a regular _ skip _ flag is determined, the flag bit of the mode to be decoded is a regular _ skip _ flag, and the decoding condition of the flag bit of the mode to be decoded is 'UMVEAvailable | | | AWPAvailable | | | ETMVPAvailable | | | | AffiniAvailable', namely when any one of the UMVE mode, the AWP mode, the ETMVP mode and the Affine mode is available, it is determined that the current block meets the decoding condition of the flag bit of the mode to be decoded, namely the current block does not meet the decoding-free condition of the flag bit of the mode to be decoded; when the UMVE mode, the AWP mode, the ETMVP mode and the Affine mode are unavailable, determining that the current block does not meet the decoding condition of the flag bit of the mode to be decoded, namely that the current block meets the decoding-free condition of the flag bit of the mode to be decoded.
Before decoding the coding information of the regular _ skip _ flag, decoding information can be obtained, whether the current block meets the decoding condition of a flag bit of a mode to be decoded or not is determined according to the obtained decoding information and the enabling limiting conditions of the UMVE mode, the AWP mode, the ETMVP mode and the Affinie mode, and if the current block meets the decoding condition (namely the decoding-free condition is not met, the same applies below), the binaryzation coding information of the regular _ skip _ flag is decoded to determine the value of the regular _ skip _ flag; if the decoding condition is not met (namely the decoding-free condition is met, the same is true below), the step of decoding the coding information of the regular _ skip _ flag is skipped, and the value of the regular _ skip _ flag is determined to be 1.
If the value of the regular _ skip _ flag is 0, the value of the umve _ flag needs to be determined.
When the value of the UMVE _ flag is determined, the flag bit of the mode to be decoded is the UMVE _ flag, the decoding condition of the flag bit of the mode to be decoded is "regular _ skip _ flag is 0& & UMVEAvailable & (AWPAvailable | | | ETMVPAvailable | | AffineAvailable)", that is, if the value of the UMVE _ flag is 0, the UMVE mode is available, and any one of the AWP mode, the ETMVP mode and the Affine mode is available, the decoding condition meeting the UMVE _ flag is determined, and the coding information of the UMVE _ flag needs to be decoded; otherwise, it is determined that the decoding condition of umve _ flag is not satisfied.
Before decoding the coded information of the umve _ flag, whether the current block meets the decoding condition of a flag bit of a mode to be decoded or not can be determined according to the obtained decoding information and the limit conditions of the permission enabling of the AWP mode, the ETMVP mode and the Affinie mode, and if the decoding condition is met, the coded information of the umve _ flag is decoded to determine the value of the umve _ flag; if the decoding condition is not met, the step of decoding the encoding information of the umve _ flag is skipped, and the value of the umve _ flag is directly deduced to be 1.
If umve _ flag takes a value of 0, the value of awp _ flag needs to be determined.
When determining the value of AWP _ flag, the flag bit of the mode to be decoded is AWP _ flag, and the decoding condition of the flag bit of the mode to be decoded 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 any one of ETMVP mode and Affine mode is available, the decoding condition of the flag bit of the mode to be decoded is determined to be satisfied; otherwise, determining that the decoding condition of the mode flag bit to be decoded is not satisfied.
Before the AWP _ flag is decoded, whether the current block meets the decoding condition of the flag bit of the mode to be decoded or not can be determined according to the acquired decoding information and the limit conditions of the permission enabling of the AWP mode, the ETMVP mode and the Affine mode, and if the decoding condition is met, the AWP _ flag coding information is decoded to determine the value of AWP _ flag; if the decoding condition is not met, the step of decoding the coding information of awp _ flag is skipped, and the value of awp _ flag is directly deduced to be 1.
If awp _ flag takes a value of 0, the value of affine _ flag needs to be determined.
When determining the value of Affine _ flag, the flag bit of the mode to be decoded is Affine _ flag, and the decoding condition of the flag bit of the mode to be decoded is that "regular _ skip _ flag is 0& & umve _ flag is 0& & awp _ flag is 0& & ETMVPAvailable & & AffineAvailable", that is, if the regular _ skip _ flag value is 0, the umve _ flag value is 0, the awp _ flag value is 0, the ETMVP mode is available, and the Affine mode is available, the decoding condition of the flag bit of the mode to be decoded is determined to be satisfied; otherwise, determining that the decoding condition of the mode flag bit to be decoded is not satisfied.
Before decoding the encoding of the Affine _ flag, whether the current block meets the decoding condition of the flag bit of the mode to be decoded or not can be determined according to the acquired decoding information and the limitation conditions of the ETMVP mode and the Affine mode allowed to be enabled, and if the decoding condition is met, the encoding information of the Affine _ flag is decoded to determine the value of the Affine _ flag; and if the decoding condition is not met, skipping the step of decoding the encoding information of the Affine _ flag, and determining that the value of the Affine _ flag is 0 or 1 according to the available condition of the Affinine mode.
Exemplarily, if the affinity mode is available, determining the value of Affine _ flag to be 1; otherwise, the Affinine mode is unavailable, and the value of Affine _ flag is determined to be 0.
EXAMPLE seven
Assuming that the mode flag bits to be evaluated include a regular _ skip _ flag, an umve _ flag, an affine _ flag, and an awp _ flag as an example, a corresponding relationship between the evaluation value of each mode flag bit and the enabling of the prediction mode is shown in table 7.1:
TABLE 7.1
Figure BDA0002817963940000301
Its corresponding binary tree diagram may be as shown in fig. 5D.
Illustratively, for the regular _ skip _ flag, the umve _ flag, the affine _ flag, and the awp _ flag, in the case where the conditions shown in table 7.2 are satisfied, the coding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
Illustratively, the "satisfied condition" described in table 7.2 is a decoding condition for the corresponding mode flag bit, and when the condition is not satisfied, it may be referred to that the current block satisfies the decoding-free condition for the corresponding mode flag bit.
TABLE 7.2
Figure BDA0002817963940000302
For example, the limitation conditions that each prediction mode allows to be enabled can be referred to the related description in the fourth embodiment.
For example, syntax logic of the mode flag bit decoding may be similar to that implemented in the fourth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5D, the first value is 0, and the second value is 1.
When the value of a regular _ skip _ flag is determined, the flag bit of the mode to be decoded is a regular _ skip _ flag, and the decoding condition of the flag bit of the mode to be decoded is 'UMVEAvailable | | | AWPAvailable | | | ETMVPAvailable | | | | AffiniAvailable', namely when any one of the UMVE mode, the AWP mode, the ETMVP mode and the Affine mode is available, it is determined that the current block meets the decoding condition of the flag bit of the mode to be decoded, namely the current block does not meet the decoding-free condition of the flag bit of the mode to be decoded; when the UMVE mode, the AWP mode, the ETMVP mode and the Affine mode are unavailable, determining that the current block does not meet the decoding condition of the flag bit of the mode to be decoded, namely that the current block meets the decoding-free condition of the flag bit of the mode to be decoded.
Before decoding the coding information of the regular _ skip _ flag, decoding information can be obtained, whether the current block meets the decoding condition of a flag bit of a mode to be decoded or not is determined according to the obtained decoding information and the enabling limiting conditions of the UMVE mode, the AWP mode, the ETMVP mode and the Affinie mode, and if the current block meets the decoding condition (namely the decoding-free condition is not met, the same applies below), the binaryzation coding information of the regular _ skip _ flag is decoded to determine the value of the regular _ skip _ flag; if the decoding condition is not met (namely the decoding-free condition is met, the same applies below), the step of decoding the coding information of the regular _ skip _ flag is skipped, and the value of the regular _ skip _ flag is directly deduced to be 1.
If the value of the regular _ skip _ flag is 0, the value of the umve _ flag needs to be determined.
When the value of the UMVE _ flag is determined, the flag bit of the mode to be decoded is the UMVE _ flag, the decoding condition of the flag bit of the mode to be decoded is "regular _ skip _ flag is 0& & UMVEAvailable & (AWPAvailable | | | ETMVPAvailable | | AffineAvailable)", that is, if the value of the UMVE _ flag is 0, the UMVE mode is available, and any one of the AWP mode, the ETMVP mode and the Affine mode is available, the decoding condition meeting the UMVE _ flag is determined, and the coding information of the UMVE _ flag needs to be decoded; otherwise, it is determined that the decoding condition of umve _ flag is not satisfied.
Before decoding the coded information of the umve _ flag, whether the current block meets the decoding condition of a flag bit of a mode to be decoded or not can be determined according to the obtained decoding information and the limit conditions of the permission enabling of the AWP mode, the ETMVP mode and the Affinie mode, and if the decoding condition is met, the coded information of the umve _ flag is decoded to determine the value of the umve _ flag; if the decoding condition is not met, the step of decoding the encoding information of the umve _ flag is skipped, and the value of the umve _ flag is directly deduced to be 1.
If the umve _ flag value is 0, the value of affine _ flag needs to be determined.
When determining the value of AWP _ flag, the flag bit of the mode to be decoded is Affine _ flag, and the decoding condition of the flag bit of the mode to be decoded is "regular _ skip _ flag is 0& & umve _ flag is 0& & AffineAvailable & (ETMVPAvailable)", i.e. if the value of regular _ skip _ flag is 0, the value of umve _ flag is 0, the Affine mode is available, and either of ETMVP mode and AWP mode is available, the decoding condition of the flag bit of the mode to be decoded is determined to be satisfied; otherwise, determining that the decoding condition of the mode flag bit to be decoded is not satisfied.
Before decoding the encoding of the Affine _ flag, whether the current block meets the decoding condition of the flag bit of the mode to be decoded or not can be determined according to the acquired decoding information and the enabling limiting conditions of the ETMVP mode, the AWP mode and the Affine mode, and if the decoding condition is met, the encoding information of the Affine _ flag is decoded to determine the value of the Affine _ flag; and if the decoding condition is not met, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 1.
If the affine _ flag value is 0, the value of awp _ flag needs to be determined.
When the value of AWP _ flag is determined, the flag bit of the mode to be decoded is AWP _ flag, and the decoding condition of the flag bit of the mode to be decoded is that "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, ETMVP mode is available, and AWP mode is available, then the decoding condition of the flag bit of the mode to be decoded is determined to be satisfied; otherwise, determining that the decoding condition of the mode flag bit to be decoded is not satisfied.
Before the AWP _ flag is decoded, whether the current block meets the decoding condition of a mode flag bit to be decoded or not can be determined according to the acquired decoding information and the limitation conditions of the ETMVP mode and the AWP mode allowed activation, and if the current block meets the decoding condition, the AWP _ flag coding information is decoded to determine the value of AWP _ flag; and if the decoding condition is not met, skipping the step of decoding the awp _ flag coding information, and determining that the value of awp _ flag is 0 or 1 according to the availability of the Affinine mode.
Illustratively, if the AWP mode is available, the value AWP _ flag is determined to be 1; otherwise, the AWP mode is not available and the value of AWP _ flag is determined to be 0.
The following describes a prediction mode decoding procedure when the value of skip _ flag is 0, with reference to an embodiment.
Example eight
When the skip _ flag is 0, it is required to determine whether the current prediction mode is the direct mode according to a value of a mode flag bit (direct _ flag) of the direct mode.
decoding process of direct _ flag:
modes 8.1,
If the current block uses the normal intra prediction or the block copy intra prediction or the string copy intra prediction (that is, the condition of disabling the direct mode is satisfied), the encoding information of the direct _ flag does not need to be decoded, and the value of the direct _ flag is determined to be equal to 0 (that is, the first value).
Modes 8.2,
If the current block uses normal intra prediction or block copy intra prediction or string copy intra prediction, or the width height of the current block is smaller than the threshold WH2 (i.e., the second threshold) (i.e., the disabled condition of the direct mode is satisfied), it is not necessary to decode the encoded information of the direct _ flag, and it is determined that the value of the direct _ flag is equal to 0 (i.e., the first value).
Otherwise, decoding the coded information of the direct _ flag to determine the value of the direct _ flag.
Exemplary, mode 8.2 WH2 is 16.
Illustratively, a direct _ flag value of 1 indicates that the current coding unit directly multiplexes motion information of neighboring blocks without parsing detailed motion vector difference information.
The following describes a prediction mode decoding procedure for the case where the value of direct _ flag is 1(InterPF mode is allowed to be enabled) with reference to an embodiment.
Example nine
Assuming that the mode flag bits to be determined include umve _ awp _ etmvp _ flag, interpf _ flag, affine _ flag, etmvp _ flag, and awp _ flag as an example, the correspondence between the values of the mode flag bits and the enablement of the prediction mode is shown in table 9.1:
TABLE 9.1
Figure BDA0002817963940000331
Its corresponding binary tree diagram may be as shown in fig. 5E.
Illustratively, for umve _ awp _ etmvp _ flag, interpf _ flag, affine _ flag, etmvp _ flag, and awp _ flag, in the case where the conditions shown in table 9.2 are satisfied, the encoding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
TABLE 9.2
Figure BDA0002817963940000332
For example, the limitation conditions for enabling the conventional direct mode, Affine mode, UMVE mode, AWP mode and ETMVP mode can be referred to the related description in the fourth embodiment.
The limiting conditions for enabling the InterPF mode are as follows:
InterPFAvailable=sh_InterpfEnableFlag&&(width*height>=TH_SIZE2)&&(width<=TH_W4)&&(height<=TH_H4)
sh _ InterpfEnablFlag is a sequence level switch of an InterPF mode, and when the sequence level switch of the InterPF mode is in an open state, the value of sh _ InterpfEnablFlag is 1; when a sequence level switch of the InterPF mode is in an off state, the value of sh _ InterpfEnablFlag is 0;
when the product of the width and the height of the current block is greater than or equal to TH _ SIZE2 (i.e., the second SIZE threshold mentioned above), (width height > -TH _ SIZE2) takes a value of 1; when the product of the width and the height of the current block is smaller than TH _ SIZE2, (width height > -TH _ SIZE2) is 0;
when the width of the current block is less than or equal to TH _ W4 (i.e., the fourth width threshold), the value (width ═ TH _ W4) is 1; when the width of the current block is greater than TH _ W4, (width < ═ TH _ W4) takes a value of 0;
when the height of the current block is less than or equal to TH _ H4 (i.e., the fourth height threshold), height < ═ TH _ H4) takes a value of 1; when the height of the current block is greater than TH _ H4, (height < ═ TH _ H4) takes a value of 0.
When sh _ interpffenable flag, (width > ═ TH _ SIZE2), (width < ═ TH _ W4) and (height > ═ TH _ H4) all take values of 1, that is, the restriction condition for enabling the InterPF mode is satisfied, the InterPFAvailable takes a value of 1, and the InterPF mode is available;
when any value of sh _ interpffenable flag, (width > ═ TH _ SIZE2), (width < ═ TH _ W4), and (height < ═ TH _ H4) is 0, that is, the restriction condition for enabling the InterPF mode is not satisfied, the InterPFAvailable value is 0, and the InterPF mode is not available.
Illustratively, TH _ SIZE2 takes a value of 64, TH _ W4 takes a value of 64, and TH _ H4 takes a value of 64.
Illustratively, the syntax logic for the mode flag bit decoding described above is as follows:
Figure BDA0002817963940000341
Figure BDA0002817963940000351
based on the syntax logic, when the direct _ flag value is 1, if at least one of sh _ UmveEnableFlag, sh _ awbleflag & (width > ═ 8) & (height > ═ 8) & (width < = 64) & (height > & (height < ═ 64) & (PictureType ═ 2), and sh _ etmvnapbleflag & (width > - & (height >) 8) is taken as 1, that is, the current block satisfies a restriction condition that any one of the UMVE mode, the AWP mode, and the ETMVP mode is allowed to be enabled, the coding information of the UMVE _ AWP _ mvp _ flag needs to be decoded.
If UMVE _ AWP _ ETMVP _ flag, sh _ EtmvpEnableFlag & (width > ═ 8) & (height > ═ 8), sh _ UmveEnableFlag | (sh _ AwpEnableFlag & (width × height > & (64) & (height < ═ 64) & & (picture type 2)) all take a value of 1, that is, the value of UMVE _ AWP _ ETMVP _ flag is 1, and the restriction condition that the current block is allowed to be enabled is satisfied, and the current block satisfies the enable condition of any one of the UMVE mode and the AWP mode, the coding information of the etp _ flag needs to be decoded.
If umve _ awp _ etmvp _ flag,! The value of each of the etmvp _ flag and the sh _ UmveEnableFlag | (sh _ AwpEnableFlag & (width × height > &64) & (width < (64) & & (height > & (64)) & & (PictureType ═ 2)) is 1, that is, the value of UMVE _ AWP _ etmvp _ flag is 1, the value of etmvp _ flag is 0, and the current block satisfies the restriction condition that any one of the UMVE mode and the AWP mode is allowed to be enabled, it is necessary to decode the coded information of AWP _ flag.
If! The values of the umve _ awp _ etmvp _ flag and the sh _ AffineEnableFlag & (width > ═ 16) & & (height > = 16) are all 1, that is, the value of the umve _ awp _ etmvp _ flag is 0, and the current block satisfies the restriction condition that the Affine mode is allowed to be enabled, the coded information of the Affine _ flag needs to be decoded.
If! umve _ awp _ etmvp _ flag,! The values of affine _ flag and sh _ InterpfEnableFlag & (width × height > ═ 64) & (width < ═ 64) & (height < ═ 64) are all 1, i.e., umve _ awp _ etmvp _ flag takes a value of 0, affine _ flag takes a value of 0, and the current block meets the condition that the InterPF mode is allowed to be enabled, the InterPF _ flag needs to be decoded.
For the binary tree diagram shown in fig. 5E, the first value is 0, and the second value is 1.
When the value of UMVE _ AWP _ ETMVP _ flag is determined, the at least one prediction mode may be a normal direct mode, an inter pf mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the encoding information of UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block may be obtained, and it is determined whether the current block does not satisfy the enabling restriction conditions of the UMVE mode, the AWP mode and the ETMVP mode according to the obtained decoding information and the enabling restriction conditions of the UMVE mode, the AWP mode and the ETMVP mode. If the UMVE mode, the AWP mode and the ETMVP are unavailable, skipping the step of decoding the encoding information of the UMVE _ AWP _ ETMVP _ flag, and directly deducing to obtain a value of the UMVE _ AWP _ ETMVP _ flag as 0; if any prediction mode of the UMVE mode, the AWP mode and the ETMVP mode is available, decoding the encoded information of the UMVE _ AWP _ ETMVP _ flag to determine whether the value of the UMVE _ AWP _ ETMVP _ flag is 0 or 1.
If the umve _ awp _ etmvp _ flag value is 0, it is determined that a conventional direct mode, an InterPF mode or an Afffine mode needs to be enabled, and at the moment, the value of Affine _ flag needs to be determined.
When the value of Affine _ flag is determined, at least one prediction mode can be a conventional direct mode, or an inter PF mode, or an Affinine mode, and before decoding the encoding information of the Affine _ flag, whether the current block does not meet the limitation condition of the Affinine mode allowed to be enabled can be determined according to the acquired decoding information and the limitation condition of the Affinine mode allowed to be enabled; if yes, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 0; otherwise, decoding the encoding information of the affine _ flag to determine whether the value of the affine _ flag is 0 or 1.
If the value of affine _ flag is 0, determining that the current block enables a conventional direct mode or an InterPF mode, and at the moment, determining the value of Interpf _ flag; and if the value of Affine _ flag is 1, determining that the current block enables an affinity mode.
When the value of the InterPF _ flag is determined, at least one prediction mode is a conventional direct mode and an InterPF mode, before the coding information of the InterPF _ flag is decoded, whether the current block does not meet the limitation condition that the InterPF mode is allowed to be enabled can be determined according to the obtained decoding information and the limitation condition that the InterPF mode is allowed to be enabled, if yes, the step of decoding the coding information of the InterPF _ flag is skipped, and the value of the InterPF _ flag is directly deduced to be 0; otherwise, decoding the coded information of the interpf _ flag to determine whether the value of the interpf _ flag is 0 or 1.
If the value of interpf _ flag is 0, determining that the current block enables a conventional direct mode; and if the value of InterPF _ flag is 1, determining that the current block enables an InterPF mode.
If the umve _ awp _ etmvp _ flag value is 1, the value of the etmvp _ flag needs to be determined.
When determining the value of ETMVP _ flag, the at least one prediction mode may be a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the coded information of the ETMVP _ flag, whether the current block does not meet the limitation condition of the ETMVP mode allowed activation can be determined according to the obtained decoded information and the limitation condition of the ETMVP mode allowed activation; if yes, skipping the step of decoding the coded information of the etmvp _ flag, and directly deducing to obtain the value of the etmvp _ flag as 0; otherwise, decoding the coded information of the etmvp _ flag to determine whether the value of the etmvp _ flag is 0 or 1.
And if the value of the ETMVP _ flag is 1, determining that the current block enables an ETMVP mode.
If the value of etmvp _ flag is 0, determining that the current block enables a UMVE mode or an AWP mode, and at this time, determining AWP _ flag value.
When the value of AWP _ flag is determined, at least one of the prediction modes is a UMVE mode and an AWP mode. Before the AWP _ flag coding information is decoded, whether the current block does not meet the limit condition of the AWP mode permission enabling can be determined according to the obtained decoding information and the limit condition of the AWP mode permission enabling; if yes, skipping the step of decoding the awp _ flag coding information, and directly deducing to obtain a value of awp _ flag as 0; otherwise, the encoded information of awp _ flag is decoded to determine whether the value of awp _ flag is 0 or 1.
If the value of awp _ flag is 0, determining that the current block enables the UMVE mode; if AWP _ flag takes a value of 1, it is determined that the current block enables the AWP mode.
Example ten
Assuming that the mode flag bits to be determined include umve _ awp _ etmvp _ flag, interpf _ flag, affine _ flag, umve _ flag, and awp _ flag as an example, the correspondence between the values of the mode flag bits and the enablement of the prediction mode is shown in table 10.1:
TABLE 10.1
Figure BDA0002817963940000371
Its corresponding binary tree diagram may be as shown in fig. 5F.
Illustratively, for umve _ awp _ etmvp _ flag, interpf _ flag, affine _ flag, umve _ flag, and awp _ flag, in case that the conditions shown in table 10.2 are satisfied, the coding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
TABLE 10.2
Figure BDA0002817963940000372
For example, the limitation conditions for enabling the conventional direct mode, affinity mode, UMVE mode, AWP mode and ETMVP mode can be referred to the related descriptions in the fourth embodiment.
The restriction conditions for enabling the interprof mode can be seen from the related description in the ninth embodiment.
For example, the syntax logic of the mode flag bit decoding may be similar to that implemented in the ninth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5F, the first value is 0, and the second value is 1.
When the value of UMVE _ AWP _ ETMVP _ flag is determined, the at least one prediction mode may be a normal direct mode, an inter pf mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode. Before decoding the encoding information of UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block may be obtained, and it is determined whether the current block does not satisfy the enabling restriction conditions of the UMVE mode, the AWP mode and the ETMVP mode according to the obtained decoding information and the enabling restriction conditions of the UMVE mode, the AWP mode and the ETMVP mode. If the UMVE mode, the AWP mode and the ETMVP mode are unavailable, skipping the step of decoding the encoding information of the UMVE _ AWP _ ETMVP _ flag, and directly deducing to obtain a value of the UMVE _ AWP _ ETMVP _ flag as 0; if any one of the UMVE mode, the AWP mode and the ETMVP mode is available, the encoded information of the UMVE _ AWP _ ETMVP _ flag is decoded to determine whether the value of the UMVE _ AWP _ ETMVP _ flag is 0 or 1.
If the value of umve _ awp _ etmvp _ flag is 0, determining that a conventional direct mode, an InterPF mode or an Affine mode needs to be enabled, and at this time, determining the value of Affine _ flag.
When the value of Affine _ flag is determined, at least one prediction mode can be a conventional direct mode, an inter PF mode and an Affinine mode, and before the encoding information of the Affine _ flag is decoded, whether the current block does not meet the limitation condition of the allowance of the Affinine mode according to the acquired decoding information and the limitation condition of the allowance of the Affinine mode; if yes, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 0; otherwise, decoding the encoding information of the affine _ flag to determine whether the value of the affine _ flag is 0 or 1.
If the value of affine _ flag is 0, determining that the current block enables a conventional direct mode or an InterPF mode, and at the moment, determining the value of Interpf _ flag; and if the value of Affine _ flag is 1, determining that the current block enables an affinity mode.
When the value of the InterPF _ flag is determined, at least one prediction mode is a conventional direct mode and an InterPF mode, before the coding information of the InterPF _ flag is decoded, whether the current block does not meet the limitation condition that the InterPF mode is allowed to be enabled can be determined according to the obtained decoding information and the limitation condition that the InterPF mode is allowed to be enabled, if yes, the step of decoding the coding information of the InterPF _ flag is skipped, and the value of the InterPF _ flag is directly deduced to be 0; otherwise, decoding the coded information of the interpf _ flag to determine whether the value of the interpf _ flag is 0 or 1.
If the value of interpf _ flag is 0, determining that the current block enables a conventional direct mode; and if the value of InterPF _ flag is 1, determining that the current block enables an InterPF mode.
If the value of umve _ awp _ etmvp _ flag is 1, the value of umve _ flag needs to be determined.
When the value of umve _ flag is determined, the at least one prediction mode may be an ETMVP mode, an AWP mode, and a UVME mode. Before decoding the UMVE _ flag coding information, determining whether the current block does not meet the UMVE mode enabled limiting condition according to the obtained decoding information and the UMVE mode enabled limiting condition; if so, skipping the step of decoding the encoding information of the umve _ flag, and directly deducing to obtain the value of the umve _ flag as 0; otherwise, decoding the coded information of the umve _ flag to determine whether the value of the umve _ flag is 0 or 1.
And if the value of UMVE _ flag is 1, determining that the current block enables the UMVE mode.
If the value of umve _ flag is 0, determining that the current block enables an ETMVP mode or an AWP mode, and at this time, determining AWP the value of the _ flag.
When the value of AWP _ flag is determined, at least one prediction mode is an ETMVP mode and an AWP mode. Before the AWP _ flag coding information is decoded, whether the current block does not meet the limit condition of the AWP mode permission enabling can be determined according to the obtained decoding information and the limit condition of the AWP mode permission enabling; if yes, skipping the step of decoding the awp _ flag coding information, and directly deducing to obtain a value of awp _ flag as 0; otherwise, the encoded information of awp _ flag is decoded to determine whether the value of awp _ flag is 0 or 1.
If the value of awp _ flag is 0, determining that the current block enables an ETMVP mode; if AWP _ flag takes a value of 1, it is determined that the current block enables the AWP mode.
EXAMPLE eleven
Assuming that the mode flag bits to be determined include umve _ awp _ etmvp _ flag, affine _ flag, etmvp _ intpf _ flag, awp _ flag, and intpf _ flag as an example, the corresponding relationship between the value of each mode flag bit and the enabling of the prediction mode is shown in table 11.1:
TABLE 11.1
Figure BDA0002817963940000391
Its corresponding binary tree diagram may be as shown in fig. 5G.
Illustratively, for umve _ awp _ etmvp _ flag, affine _ flag, etmvp _ interpf _ flag, awp _ flag, and interpf _ flag, in the case that the conditions shown in table 11.2 are satisfied, the encoding information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
TABLE 11.2
Figure BDA0002817963940000392
Figure BDA0002817963940000401
For example, the limitation conditions for enabling the conventional direct mode, Affine mode, UMVE mode, AWP mode and ETMVP mode can be referred to the related description in the fourth embodiment.
The restriction conditions for enabling the interprof mode can be seen from the related description in the ninth embodiment.
For example, the syntax logic of the mode flag bit decoding may be similar to that implemented in the ninth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5G, the first value is 0, and the second value is 1.
When the value of UMVE _ AWP _ ETMVP _ flag is determined, the at least one prediction mode may be a normal direct mode, an affinity mode, a UMVE mode, an AWP mode, an ETMVP mode, and an InterPF mode. Before decoding the encoding information of UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block may be obtained, and it is determined whether the current block does not satisfy the restriction conditions for enabling the UMVE mode, the AWP mode, the ETMVP mode and the inter pf mode according to the obtained decoding information and the restriction conditions for enabling the UMVE mode, the AWP mode, the ETMVP mode and the inter pf mode. If the UMVE mode, the AWP mode, the ETMVP mode and the InterPF mode are unavailable, skipping the step of decoding the coded information of the UMVE _ AWP _ ETMVP _ flag, and directly deducing to obtain a value of the UMVE _ AWP _ ETMVP _ flag as 0; if any prediction mode of the UMVE mode, the AWP mode, the ETMVP mode and the inter pf mode is available, the coded information of the UMVE _ AWP _ ETMVP _ flag is decoded to determine whether the value of the UMVE _ AWP _ ETMVP _ flag is 0 or 1.
If the value of umve _ awp _ etmvp _ flag is 0, determining that the conventional direct mode or the Affine mode needs to be enabled, and at this time, determining the value of Affine _ flag.
When determining the value of Affine _ flag, at least one prediction mode can be a conventional direct mode and an Affine mode, and before decoding the encoding information of the Affine _ flag, whether the current block does not meet the limitation condition that the Affine mode is allowed to be enabled can be determined according to the acquired decoding information and the limitation condition that the Affine mode is allowed to be enabled; if yes, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 0; otherwise, decoding the encoding information of the affine _ flag to determine whether the value of the affine _ flag is 0 or 1.
If the value of affine _ flag is 0, determining that the current block enables a conventional direct mode; and if the value of Affine _ flag is 1, determining that the current block enables an affinity mode.
If the value of umve _ awp _ etmvp _ flag is 1, the value of etmvp _ intpf _ flag needs to be determined.
When determining the value of ETMVP _ InterPF _ flag, at least one prediction mode may be a UMVE mode, an AWP mode, an ETMVP mode, and an InterPF mode. Before decoding the coded information of the ETMVP _ InterPF _ flag, whether the current block does not meet the limitation condition of the enabling permission of the ETMVP mode and the InterPF mode can be determined according to the obtained decoded information and the limitation condition of the enabling permission of the ETMVP mode and the InterPF mode; if yes, skipping the step of decoding the coded information of the etmvp _ intpf _ flag, and directly deducing to obtain the value of the etmvp _ intpf _ flag as 0; otherwise, decoding the coding information of the etmvp _ interpf _ flag to determine whether the value of the etmvp _ interpf _ flag is 0 or 1.
If the value of the etmvp _ interpf _ flag is 0, determining that the current block enables the UMVE mode or the AWP mode, and at this time, determining AWP _ flag value.
When the value of AWP _ flag is determined, at least one of the prediction modes is a UMVE mode and an AWP mode. Before the AWP _ flag coding information is decoded, whether the current block does not meet the limit condition of the AWP mode permission enabling can be determined according to the obtained decoding information and the limit condition of the AWP mode permission enabling; if yes, skipping the step of decoding the awp _ flag coding information, and directly deducing to obtain a value of awp _ flag as 0; otherwise, the encoded information of awp _ flag is decoded to determine whether the value of awp _ flag is 0 or 1.
If the value of awp _ flag is 0, determining that the current block enables the UMVE mode; if AWP _ flag takes a value of 1, it is determined that the current block enables the AWP mode.
If the value of ETMVP _ InterPF _ flag is 1, determining that the current block enables an ETMVP mode or an InterPF mode, and at this time, determining the value of the InterPF _ flag.
When the value of the InterPF _ flag is determined, at least one prediction mode is an ETMVP mode and an InterPF mode, and before the coding information of the InterPF _ flag is decoded, whether the current block does not meet the limitation condition of the InterPF mode allowed to be enabled can be determined according to the obtained decoding information and the limitation condition of the InterPF mode allowed to be enabled; if so, skipping the step of decoding the coded information of the interpf _ flag, and directly deducing to obtain the value of the interpf _ flag as 0; otherwise, decoding the coded information of the interpf _ flag to determine whether the value of the interpf _ flag is 0 or 1.
If the value of interpf _ flag is 0, determining that the current block enables an ETMVP mode; and if the value of InterPF _ flag is 1, determining that the current block enables an InterPF mode.
Example twelve
Assuming that the mode flag bits to be determined include umve _ awp _ awp _ flag, affine _ flag, umve _ interpf _ flag, awp _ flag, and interpf _ flag as an example, the corresponding relationship between the value of each mode flag bit and the enabling of the prediction mode is as shown in table 12.1:
TABLE 12.1
Figure BDA0002817963940000411
Figure BDA0002817963940000421
Its corresponding binary tree diagram may be as shown in fig. 5H.
Illustratively, for umve _ awp _ awp _ flag, affine _ flag, umve _ interpf _ flag, awp _ flag, and interpf _ flag, in case that the conditions shown in table 12.2 are satisfied, the encoded information of the corresponding mode flag bit needs to be decoded; otherwise, the process of decoding the coding information of the corresponding mode marking bit can be skipped, and the value of the corresponding mode marking bit is deduced.
TABLE 12.2
Figure BDA0002817963940000422
For example, the limitation conditions for enabling the conventional direct mode, Affine mode, UMVE mode, AWP mode and ETMVP mode can be referred to the related description in the fourth embodiment.
The restriction conditions for enabling the interprof mode can be seen from the related description in the ninth embodiment.
For example, the syntax logic of the mode flag bit decoding may be similar to that implemented in the ninth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5H, the first value is 0, and the second value is 1.
When the value of UMVE _ AWP _ ETMVP _ flag is determined, at least one prediction mode may be a normal direct mode, an affinity mode ETMVP mode, an AWP mode, a UMVE mode, and an InterPF mode. Before decoding the encoding information of UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block may be obtained, and it is determined whether the current block does not satisfy the restriction conditions for the ETMVP mode, the AWP mode, the UMVE mode and the InterPF mode permission enablement according to the obtained decoding information and the restriction conditions for the ETMVP mode, the AWP mode, the UMVE mode and the InterPF mode permission enablement. If yes, skipping the step of decoding the encoding information of the umve _ awp _ etmvp _ flag, and directly deducing to obtain a value of the umve _ awp _ etmvp _ flag as 0; if any prediction mode of the ETMVP mode, the AWP mode, the UMVE mode and the InterPF mode is available, decoding the coded information of the UMVE _ AWP _ ETMVP _ flag to determine whether the value of the UMVE _ AWP _ ETMVP _ flag is 0 or 1.
If the value of umve _ awp _ etmvp _ flag is 0, determining that the conventional direct mode or the Affine mode needs to be enabled, and at this time, determining the value of Affine _ flag.
When the value of the Affine _ flag is determined, at least one prediction mode is a normal direct mode and an Affinine mode, and before the coding information of the Affine _ flag is decoded, whether the current block does not meet the limitation condition of the Affinine mode allowable enabling can be determined according to the obtained decoding information and the limitation condition of the Affinine mode allowable enabling; if yes, skipping the step of decoding the encoding information of the affine _ flag, and directly deducing to obtain the value of the affine _ flag as 0; otherwise, decoding the encoding information of the affine _ flag to determine whether the value of the affine _ flag is 0 or 1.
If the value of affine _ flag is 0, determining that the current block enables a conventional direct mode; and if the value of Affine _ flag is 1, determining that the current block enables an affinity mode.
If the value of umve _ awp _ etmvp _ flag is 1, the value of umve _ interpf _ flag needs to be determined.
When the value of UMVE _ InterPF _ flag is determined, the at least one prediction mode may be an ETMVP mode, an AWP mode, a UMVE mode, and an InterPF mode. Before decoding the encoding information of UMVE _ InterPF _ flag, determining whether the current block does not satisfy the enabling limiting conditions of the UMVE mode and the inter PF mode according to the obtained decoding information and the enabling limiting conditions of the UMVE mode and the inter PF mode; if so, skipping the step of decoding the encoding information of the umve _ interpf _ flag, and directly deducing to obtain the value of the umve _ interpf _ flag as 0; otherwise, decoding the encoding information of the umve _ interpf _ flag to determine whether the value of the umve _ interpf _ flag is 0 or 1.
If the value of the umve _ interpf _ flag is 0, determining that the current block enables an ETMVP mode or an AWP mode, and at this time, determining AWP _ flag value.
When the value of AWP _ flag is determined, at least one prediction mode is an ETMVP mode and an AWP mode. Before the AWP _ flag coding information is decoded, whether the current block does not meet the limit condition of the AWP mode permission enabling can be determined according to the obtained decoding information and the limit condition of the AWP mode permission enabling; if yes, skipping the step of decoding the awp _ flag coding information, and directly deducing to obtain a value of awp _ flag as 0; otherwise, the encoded information of awp _ flag is decoded to determine whether the value of awp _ flag is 0 or 1.
If the value of awp _ flag is 0, determining that the current block enables an ETMVP mode; if AWP _ flag takes a value of 1, it is determined that the current block enables the AWP mode.
If the value of UMVE _ InterPF _ flag is 1, determining that the current block enables the UMVE mode or the InterPF mode, and at this time, determining the value of InterPF _ flag.
When the value of InterPF _ flag is determined, at least one prediction mode is a UMVE mode, a mode to be traversed is an InterPF mode, and before the coding information of the InterPF _ flag is decoded, whether a current block does not meet the limiting condition of the InterPF mode allowed to be started or not can be determined according to the obtained decoding information and the limiting condition of the InterPF mode allowed to be started; if so, skipping the step of decoding the coded information of the interpf _ flag, and directly deducing to obtain the value of the interpf _ flag as 0; otherwise, decoding the coded information of the interpf _ flag to determine whether the value of the interpf _ flag is 0 or 1.
If the value of interpf _ flag is 0, determining that the current block enables the UMVE mode; and if the value of InterPF _ flag is 1, determining that the current block enables an InterPF mode.
EXAMPLE thirteen
Assuming that the mode flag bits to be determined include umve _ awp _ etmvp _ flag, interpf _ flag, umve _ flag, awp _ flag, and affine _ flag as an example, the correspondence between the values of the mode flag bits and the enablement of the prediction mode is shown in table 13.1:
TABLE 13.1
Figure BDA0002817963940000441
Its corresponding binary tree diagram may be as shown in fig. 5I.
Illustratively, for umve _ awp _ etmvp _ flag, interpf _ flag, umve _ flag, awp _ flag, and affine _ flag, in the case that the conditions shown in table 13.2 are satisfied, it is determined that the decoding conditions of the mode flag bits to be decoded are satisfied, and the encoded information of the corresponding mode flag bits needs to be decoded; otherwise, determining that the decoding condition of the mode marking bit to be decoded is not satisfied, skipping the process of decoding the coding information of the corresponding mode marking bit, and deducing to obtain the value of the corresponding mode marking bit.
TABLE 13.2
Figure BDA0002817963940000442
Figure BDA0002817963940000451
For example, the limitation conditions for enabling the conventional direct mode, Affine mode, UMVE mode, AWP mode and ETMVP mode can be referred to the related description in the fourth embodiment.
The restriction conditions for enabling the interprof mode can be seen in example nine.
For example, the syntax logic of the mode flag bit decoding may be similar to that implemented in the ninth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5I, the first value is 0, and the second value is 1.
When the value of umve _ awp _ etmvp _ flag is determined, the flag bit of the mode to be decoded is umve _ awp _ etmvp _ flag, the decoding condition of the flag bit of the mode to be decoded is 'UMVEAvailable | | AWPAvailable | | | ETMVPAvailable | | AffineAvailable', and when the condition is not met, the decoding-free condition of the flag bit of the mode to be decoded is determined to be met; when it is determined that the condition is satisfied, it is determined that the decoding-exempt condition of the mode flag bit to be decoded is not satisfied.
Before decoding the encoding information of the UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block can be acquired, whether the current block meets the decoding condition of a mark bit of a mode to be decoded or not is determined according to the acquired decoding information and the enabling limiting conditions of the UMVE mode, the AWP mode, the ETMVP mode and the Affinie mode, if so, the decoding-free condition of the mark bit of the mode to be decoded is determined not to be met, and the encoding information of the UMVE _ AWP _ ETMVP _ flag is decoded; if the flag bit does not satisfy the decoding-free condition, determining that the decoding-free condition of the flag bit of the mode to be decoded is satisfied, skipping the step of decoding the encoding information of the umve _ awp _ etmvp _ flag, and directly deducing to obtain the value of the umve _ awp _ etmvp _ flag as 0.
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.
When the value of the interpf _ flag is determined, the mode flag bit to be decoded is the interpf _ flag, the decoding condition is that "umve _ awp _ etmvp _ affine _ flag is 0, and the interpf available" is satisfied, if the condition is satisfied, the decoding-free condition of the mode flag bit to be decoded is determined not to be satisfied; otherwise, determining that the decoding-free condition of the mode marking bit to be decoded is met.
Illustratively, when the value of umve _ awp _ etmvp _ affine _ flag is 0 and the inter pf mode is available, determining that the decoding-free condition of the InterPF _ flag is not met, decoding the coding information of the InterPF _ flag, and determining the value of the InterPF _ flag; when the umve _ awp _ etmvp _ affine _ flag value is 1 and/or the InterPF mode is unavailable, skipping the step of decoding the coded information of the InterPF _ flag, and directly deducing to obtain the value of the InterPF _ flag as 0.
When the value of umve _ flag is determined, the mode to be decoded is marked with umve _ flag, and the decoding condition is that "umve _ awp _ etmvp _ affine _ flag is 1& & UMVEAvailable & (AWPAvailable | | ETMVPAvailable | | AffineAvailable)".
When the value of UMVE _ AWP _ evmvp _ Affine _ flag is 1, the UMVE mode is available, and any one of the AWP mode, the ETMVP mode and the Affine mode is available, determining that the decoding-free condition of the UMVE _ flag is not met; otherwise, determining that the decoding-free condition of the UMVE _ flag is met, skipping decoding of the coding information of the UMVE _ flag, and directly deducing to obtain 1 when the value of the UMVE _ flag is 1 when the UMVE _ awp _ etmvp _ affine _ flag is 1 and the UMVE mode is available; when the value of UMVE _ awp _ etmvp _ affine _ flag is 0 and/or the UMVE mode is unavailable, the value of UMVE _ flag is directly deduced to be 0.
When the umve _ flag value is 0, the value of awp _ flag needs to be determined.
When the value of awp _ flag is determined, the mode flag bit to be decoded is awp _ flag, and the decoding condition is "umve _ awp _ etmvp _ affine _ flag is 1& & umve _ flag is 0& & AWPAvailable & (ETMVPAvailable | | AffineAvailable)".
If the umve _ AWP _ ETMVP _ Affine _ flag value is 1, the umve _ flag value is 0, the AWP mode is available, and any one of the ETMVP mode and the Afffine mode is available, determining that the decoding-free condition of AWP _ flag is not met; otherwise, determining that a decoding-free condition of AWP _ flag is met, skipping decoding of AWP _ flag coding information, and directly deducing AWP _ flag to be 1 when umve _ AWP _ etmvp _ affine _ flag takes a value of 1, umve _ flag takes a value of 0, and an AWP mode is available; when the value of umve _ AWP _ etmvp _ affine _ flag is 0, the value of umve _ flag is 1, and any condition that the AWP mode is unavailable is satisfied, determining that the value of AWP _ flag is 0.
When it is determined awp that the value of the affine flag is 0, the value of the affine flag needs to be determined.
When the value of affine _ flag is determined, the mode flag bit to be decoded is affine _ flag, and the decoding condition is "effective _ awp _ etmvp _ affine _ flag is 1& & umve _ flag is 0& & awp _ flag is 0& (ETMVPAvailable | | AffineAvailable)".
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 any one of the ETMVP mode and the Afffine mode can be used, determining that the decoding-free condition of the Affine _ flag is not met; otherwise, determining that the decoding-free condition of the Affine _ flag is met, skipping decoding of the encoding information of the Affine _ flag, and directly deriving to obtain the value of the Affine _ flag as 1 when the umve _ awp _ etmvp _ Affine _ flag value is 1, the umve _ flag value is 0, the awp _ flag value is 0, and the Affine _ flag is available in an Affinine mode; when any condition that umve _ awp _ etmvp _ Affine _ flag takes a value of 0, umve _ flag takes a value of 1, awp _ flag takes a value of 1 and an Affine _ flag takes a value of 0 is obtained through direct derivation when the condition that the Affine _ flag cannot be used in the Affine mode is satisfied.
Example fourteen
Assuming that the mode flag bits to be determined include umve _ awp _ etmvp _ flag, interpf _ flag, umve _ flag, affine _ flag, and awp _ flag as an example, the correspondence between the values of the mode flag bits and the enablement of the prediction mode is shown in table 14.1:
TABLE 14.1
Figure BDA0002817963940000471
Its corresponding binary tree diagram may be as shown in fig. 5J.
Illustratively, for umve _ awp _ etmvp _ flag, interpf _ flag, umve _ flag, affine _ flag, and awp _ flag, in the case that the conditions shown in table 14.2 are satisfied, it is determined that the decoding conditions of the mode flag bits to be decoded are satisfied, and the encoded information of the corresponding mode flag bits needs to be decoded; otherwise, determining that the decoding condition of the mode marking bit to be decoded is not satisfied, skipping the process of decoding the coding information of the corresponding mode marking bit, and deducing to obtain the value of the corresponding mode marking bit.
TABLE 14.2
Figure BDA0002817963940000472
Figure BDA0002817963940000481
For example, the limitation conditions for enabling the conventional direct mode, Affine mode, UMVE mode, AWP mode and ETMVP mode can be referred to the related description in the fourth embodiment.
The restriction conditions for enabling the interprof mode can be seen in example nine.
For example, the syntax logic of the mode flag bit decoding may be similar to that implemented in the ninth embodiment, and details of the embodiment of the present application are not repeated herein.
For the binary tree diagram shown in fig. 5J, the first value is 0, and the second value is 1.
When the value of umve _ awp _ etmvp _ flag is determined, the flag bit of the mode to be decoded is umve _ awp _ etmvp _ flag, the decoding condition of the flag bit of the mode to be decoded is 'UMVEAvailable | | AWPAvailable | | | ETMVPAvailable | | AffineAvailable', and when the condition is not met, the decoding-free condition of the flag bit of the mode to be decoded is determined to be met; when it is determined that the condition is satisfied, it is determined that the decoding-exempt condition of the mode flag bit to be decoded is not satisfied.
Before decoding the encoding information of the UMVE _ AWP _ ETMVP _ flag, some decoding information of the current block can be acquired, whether the current block meets the decoding condition of a mark bit of a mode to be decoded or not is determined according to the acquired decoding information and the enabling limiting conditions of the UMVE mode, the AWP mode, the ETMVP mode and the Affinie mode, if so, the decoding-free condition of the mark bit of the mode to be decoded is determined not to be met, and the encoding information of the UMVE _ AWP _ ETMVP _ flag is decoded; if the flag bit does not satisfy the decoding-free condition, determining that the decoding-free condition of the flag bit of the mode to be decoded is satisfied, skipping the step of decoding the encoding information of the umve _ awp _ etmvp _ flag, and directly deducing to obtain the value of the umve _ awp _ etmvp _ flag as 0.
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.
When the value of the interpf _ flag is determined, the mode flag bit to be decoded is the interpf _ flag, the decoding condition is that "umve _ awp _ etmvp _ affine _ flag is 0, and InterPFAvailable", if the condition is met, the decoding-free condition of the mode flag bit to be decoded is determined not to be met; otherwise, determining that the decoding-free condition of the mode marking bit to be decoded is met.
Illustratively, when the value of umve _ awp _ etmvp _ affine _ flag is 0 and the inter pf mode is available, determining that the decoding-free condition of the InterPF _ flag is not met, decoding the coding information of the InterPF _ flag, and determining the value of the InterPF _ flag; and when the umve _ awp _ etmvp _ affine _ flag value is 1 and/or the InterPF mode is unavailable, skipping the step of decoding the coding information of the InterPF _ flag, and directly deducing to obtain the value of the InterPF _ flag to be 0.
When the value of umve _ flag is determined, the mode to be decoded is marked with umve _ flag, and the decoding condition is that "umve _ awp _ etmvp _ affine _ flag is 1& & UMVEAvailable & (AWPAvailable | | ETMVPAvailable | | AffineAvailable)".
When the value of UMVE _ AWP _ ETMVP _ Affine _ flag is 1, the UMVE mode is available, and any one of the AWP mode, the ETMVP mode and the Affinine mode is available, determining that the decoding-free condition of the UMVE _ flag is not met; otherwise, determining that the decoding-free condition of the UMVE _ flag is met, skipping decoding of the coding information of the UMVE _ flag, and directly deducing to obtain 1 when the value of the UMVE _ flag is 1 when the UMVE _ awp _ etmvp _ affine _ flag is 1 and the UMVE mode is available; when the value of UMVE _ awp _ etmvp _ affine _ flag is 0 and/or the UMVE mode is unavailable, the value of UMVE _ flag is directly deduced to be 0.
When the umve _ flag value is 0, the value of affine _ flag needs to be determined.
When the value of affine _ flag is determined, the mode flag bit to be decoded is affine _ flag, and the decoding condition is "effective _ awp _ etmvp _ affine _ flag is 1& & umve _ flag is 0& & Affiniavailable & (ETMVPAvailable | | AWPAvailable)".
If the umve _ AWP _ ETMVP _ Affine _ flag value is 1, the umve _ flag value is 0, the Afffine mode is available, and any one of the ETMVP mode and the AWP mode is available, determining that the decoding-free condition of the Affine _ flag is not met; otherwise, determining that the decoding-free condition of the Affine _ flag is met, skipping decoding of the Affine _ flag coding information, and directly deducing to obtain an Affine _ flag value of 1 when the umve _ awp _ etmvp _ Affine _ flag value is 1, the umve _ flag value is 0, and an Affine _ flag mode is available; when the value of umve _ awp _ etmvp _ Affine _ flag is 0, the value of umve _ flag is 1, and any condition that the Affine _ flag is unavailable is satisfied, the value of Affine _ flag is directly derived to be 0.
When determining that the affine _ flag value is 0, the value of awp _ flag needs to be determined.
When the value of awp _ flag is determined, the mode flag bit to be decoded is awp _ flag, and the decoding condition is "umve _ awp _ etmvp _ affine _ flag is 1& & umve _ flag is 0& & affine _ flag is 0& (ETMVPAvailable | | awwavailable)".
If the umve _ AWP _ ETMVP _ affine _ flag value is 1, the umve _ flag value is 0, the affine _ flag value is 0, and any one of an ETMVP mode and an AWP mode is available, determining that the decoding-free condition of AWP _ flag is not met; otherwise, determining that a decoding-free condition of AWP _ flag is met, skipping decoding of the encoding information of AWP _ flag, and directly deducing to obtain a value of AWP _ flag as 1 when umve _ AWP _ etmvp _ affine _ flag takes a value of 1, umve _ flag takes a value of 0, affine _ flag takes a value of 0, and an AWP mode is available; when 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 any condition that the AWP mode is unavailable is satisfied, the value of AWP _ flag is directly derived to be 0.
It should be noted that, the setting of the mode flag bit in the foregoing embodiment is only an example of the setting manner of the mode flag bit in the embodiment of the present application, and is not limited to the protection scope of the embodiment of the present application, and in the embodiment of the present application, the setting of the mode flag bit may also include other implementation manners, which may use a shorter codeword for the mode flag bit according to the usage probability of each mode according to "for a prediction mode with a higher usage probability; for the mode with higher probability, the mode flag bit is set by adopting the principle of longer code word ", for example, for the mode with higher probability, the mode flag bit can be closer to the root node of the binary tree; for patterns with smaller probabilities, the pattern flag bits may be further away from the root node of the binary tree; or, a new embodiment may be obtained by combining any of the above embodiments, and specific implementation thereof is not described herein again.
In addition, for any mode flag bit, the candidate prediction mode under the condition of different values thereof is not limited to the above example, for example, taking the binary tree diagram shown in fig. 5A as an example, for the umve _ awp _ etmvp _ flag, the normal skip mode or the Affine mode may also be determined to be enabled under the condition that the umve _ awp _ etmvp _ flag takes a value of 1; for the Affine _ flag, the Affine mode may also be determined to be enabled when the value of the Affine _ flag is 0, and the specific implementation thereof is not described herein.
In addition, the above embodiments are described with reference to the decoding flow at the decoding end, and the implementation at the encoding end may refer to the description of the decoding flow.
The methods provided herein are described above. The following describes the apparatus provided in the present application:
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure. The electronic device may include a processor 601, a machine-readable storage medium 602 having machine-executable instructions stored thereon. The processor 601 and the machine-readable storage medium 602 may communicate via a system bus 603. Also, the processor 601 may perform the prediction mode decoding method or the prediction mode encoding method described above by reading and executing machine-executable instructions corresponding to decode control or encoding control logic in the machine-readable storage medium 602.
The machine-readable storage medium 602 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
In some embodiments, there is also provided a machine-readable storage medium having stored therein machine-executable instructions that, when executed by a processor, implement the prediction mode decoding method or the prediction mode encoding method described above. For example, the machine-readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and so forth.
In some embodiments, as shown in fig. 7, when the electronic device is used as a decoding-side device, the decoding control logic may include:
a determining unit 710, configured to determine, for a current block, before decoding binary encoding information of a flag bit of a mode to be decoded, whether the current block satisfies a decoding-free condition of the flag bit of the mode to be decoded according to specific information of the current block;
a decoding unit 720, configured to determine, according to the specific information, that a binary value of the to-be-decoded mode flag bit is a first value or a second value if the current block satisfies a decoding-free condition of the to-be-decoded mode flag bit;
the decoding unit 720 is further configured to, if the current block does not satisfy the decoding-free condition of the mode flag bit to be decoded, read the binarization encoding information of the mode flag bit to be decoded, decode the encoding information, and determine that the binarization value of the mode flag bit to be decoded is a first value or a second value;
wherein the specific information includes a value of at least one obtained mode flag bit and/or decoding information whether at least one prediction mode is available.
As an example, the determining unit 710 is further configured to, before decoding the binarized encoded information of the control switch flag bit of the first target prediction mode, obtain and determine whether the current block satisfies a decoding-free condition of the first target prediction mode according to the decoding information of the current block;
the decoding unit 720 is further configured to skip the step of decoding the binarized encoded information of the control switch flag bit of the first target prediction mode if the current block meets the decoding-free condition of the first target prediction mode, and determine that the binarized 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, executing the step of decoding the binary coding information of the control switch flag bit of the first target prediction mode;
and if the binary value of the control switch flag bit of the first target prediction mode is decoded to be the second value, executing the step of judging whether the current block meets the decoding-free condition of the flag bit of the mode to be decoded or not according to the specific information of the current block.
As an example, the determining unit 710 is further configured to, before decoding the binary encoded information of the flag bit of the control switch 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;
the decoding unit 720 is further configured to skip the step of decoding the binarized encoded information of the control switch flag bit of the second target prediction mode if the current block meets the decoding-free condition of the second target prediction mode, and determine that the binarized value of the control switch flag bit 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, executing the step of decoding the binary coding information of the control switch flag bit of the second target prediction mode;
and if the binary value of the control switch flag bit of the second target prediction mode is decoded to be the second value, executing the step of acquiring and judging whether the current block meets the decoding-free condition of the first target prediction mode according to the decoding information of the current block.
As an example, the at least one prediction mode when the skip mode is enabled includes one or more of a normal skip mode, an Affine mode, an advanced motion vector expression mode UMVE mode, an angular weighted prediction mode AWP mode, and an enhanced temporal motion vector prediction mode ETMVP mode.
As an example, the decode-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a first threshold.
As an example, the first target prediction mode is a direct mode, and the second target prediction mode is a skip mode;
when the direct mode is enabled, the at least one prediction mode includes one or more of a normal direct mode, an inter pf mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode.
As an example, the decode-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is smaller than a second threshold value;
the decode-free condition of the second target prediction mode comprises one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a third threshold.
As an example, for any prediction mode of the at least one prediction mode, the decoding information whether it is available includes one or more of switch state information, size information of the current block, and frame type information.
As an example, for any of the at least one prediction mode, determining whether the decoding information is available based on whether the prediction mode is available comprises:
determining whether the current block satisfies a constraint condition that the prediction mode is allowed to be enabled based on decoding information whether the prediction mode is available;
if yes, determining that the prediction mode is available; otherwise, determining that the prediction mode is unavailable;
when the prediction mode is the UMVE mode, the limitation condition for allowing the activation comprises that a sequence level switch of the UMVE mode is in an open state;
when the prediction mode is an AWP mode, the limitations that allow enabling include one or more of:
the sequence level switch of the AWP mode is in an open state, the product of the width and the height of the current block is larger than or equal to a first size threshold value, the width of the current block is smaller than or equal to a first width threshold value, the height of the current block is smaller than or equal to a first height threshold value, and the frame type of the frame to which the current block belongs is a B frame;
when the prediction mode is ETMVP mode, the allowable constraints include one or more of the following:
the sequence level switch of the ETMVP mode is in an open state, the width of the current block is greater than or equal to a second width threshold value, and the height of the current block is greater than or equal to a second height threshold value;
when the prediction mode is the affinity mode, the limitation conditions allowed to be enabled include one or more of the following:
the sequence level switch of the Affinine mode is in an open state, the width of the current block is greater than or equal to a third width threshold value, and the height of the current block is greater than or equal to a third height threshold value;
when the prediction mode is the inter pf mode, the allowable enabling constraints include one or more of the following;
the sequence level switch of the InterPF mode is in an open state, the product of the width and the height of the current block is greater than or equal to a second size threshold value, the width of the current block is less than or equal to a fourth width threshold value, and the height of the current block is less than or equal to a fourth height threshold value.
In some embodiments, as shown in fig. 8, when the electronic device serves as an encoding end device, the encoding control logic may include:
a determining unit 810, configured to determine, for a current block, whether the current block satisfies a coding-free condition of a flag bit of a mode to be coded before writing binary coding information of the flag bit of the mode to be coded into a code stream;
an encoding unit 820, configured to skip the step of writing the binarization encoding information of the mode flag bit to be encoded into a code stream if the current block satisfies the coding-free condition of the mode flag bit to be encoded;
the encoding unit 820 is further configured to, if the current block does not satisfy the coding-free condition of the mode flag bit to be encoded, write the binarization encoding information of the mode flag bit to be encoded into a code stream.
As an example, the determining unit 810 is further configured to determine whether the current block satisfies a decoding-free 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;
the encoding unit 820 is further configured to skip the step of writing the binarization encoding information of the control switch flag bit of the first target prediction mode into the code stream if the current block meets the decoding-free condition of the first target prediction mode, and determine that the binarization 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, executing a step of writing the binary coding information of the control switch flag bit of the first target prediction mode into a code stream;
and if the binary value of the control switch flag bit of the first target prediction mode is the second value, determining to execute a step of judging whether the current block meets the coding-free condition of the flag bit of the mode to be coded.
As an example, the determining unit is further configured to determine whether the current block satisfies a decoding-free 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;
if the current block meets the decoding-free condition of the second target prediction mode, skipping the step of writing the binary coding information of the control switch flag bit of the second target prediction mode into the code stream, and determining that the binary value of the control switch flag bit 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, executing a step of writing the binary coding information of the control switch flag bit of the second target prediction mode into the code stream;
and if the binary value of the control switch flag bit of the second target prediction mode is the second value, determining to execute the step of judging whether the current block meets the forbidden condition of the first target prediction mode.
As an example, the first target prediction mode is skip mode;
the at least one prediction mode comprises one or more prediction modes in candidate prediction modes when the skip mode is enabled;
when the skip mode is enabled, the at least one prediction mode includes one or more of a normal skip mode, an affinity mode, a UMVE mode, an AWP mode, and an ETMVP mode.
As an example, the decode-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a first threshold.
As an example, the first threshold is 16.
As an example, the first target prediction mode is a direct mode, and the second target prediction mode is a skip mode;
when the direct mode is enabled, the at least one prediction mode comprises one or more of a conventional direct mode, an InterPF mode, an affinity mode, a UMVE mode, an AWP mode and an ETMVP mode.
As an example, the decode-free condition of the first target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is smaller than a second threshold value;
the decoding-free condition of the second target prediction mode includes one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a third threshold.
As an example, the second threshold is 16, and/or the third threshold is 16.
As an example, for any prediction mode of the at least one prediction mode, the decoding information whether it is available includes one or more of switch state information, size information of the current block, and frame type information.
As an example, for any prediction mode of the at least one prediction mode, determining whether the prediction mode is available based on the decoding information whether the prediction mode is available comprises:
determining whether the current block satisfies a constraint condition that the prediction mode is allowed to be enabled based on decoding information whether the prediction mode is available;
if yes, determining that the prediction mode is available; otherwise, determining that the prediction mode is unavailable;
when the prediction mode is the UMVE mode, the limitation condition for allowing the activation comprises that a sequence level switch of the UMVE mode is in an open state;
when the prediction mode is an AWP mode, the limitations that allow enabling include one or more of:
the sequence level switch of the AWP mode is in an open state, the product of the width and the height of the current block is larger than or equal to a first size threshold value, the width of the current block is smaller than or equal to a first width threshold value, the height of the current block is smaller than or equal to a first height threshold value, and the type of SLICE to which the current block belongs is SLICE _ B;
when the prediction mode is ETMVP mode, the allowable constraints include one or more of the following:
the sequence level switch of the ETMVP mode is in an open state, the width of the current block is greater than or equal to a second width threshold value, and the height of the current block is greater than or equal to a second height threshold value;
when the prediction mode is the affinity mode, the limitation conditions allowed to be enabled include one or more of the following:
the sequence level switch comprising the Affinine mode is in an open state, the width of the current block is greater than or equal to a third width threshold value, and the height of the current block is greater than or equal to a third height threshold value;
when the prediction mode is the inter pf mode, the allowable enabling constraints include one or more of the following;
the sequence level switch of the InterPF mode is in an open state, the product of the width and the height of the current block is greater than or equal to a second size threshold value, the width of the current block is less than or equal to a fourth width threshold value, and the height of the current block is less than or equal to a fourth height threshold value.
In some embodiments, there is also provided a camera apparatus including the prediction mode decoding means or the prediction mode encoding means in the above embodiments.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (13)

1. A prediction mode decoding method, comprising:
for a current block, before the binary coding information of a mode marking bit to be decoded is decoded, judging whether the current block meets the decoding-free condition of the mode marking bit to be decoded according to the specific information of the current block;
if the current block meets the decoding-free condition of the mark bit of the mode to be decoded, determining the binarization value of the mark bit of the mode to be decoded as a first value or a second value according to the specific information;
if the current block does not meet the decoding-free condition of the mode marking bit to be decoded, reading the binary coding information of the mode marking bit to be decoded, decoding the coding information, and determining that the binary value of the mode marking bit to be decoded is a first value or a second value;
wherein the specific information includes a value of at least one obtained mode flag bit and/or decoding information whether at least one prediction mode is available.
2. The method of claim 1, wherein before determining whether the current block satisfies the decoding-free condition of the mode flag bit to be decoded according to the specific information of the current block, the method further comprises:
before the binary coding information of the control switch flag bit of the first target prediction mode is decoded, acquiring and judging 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, skipping the step of decoding the binarization encoding information of the control switch flag bit of the first target prediction mode, and determining the binarization value of the control switch flag bit of the first target prediction mode as the first value;
if the current block does not meet the decoding-free condition of the first target prediction mode, executing the step of decoding the binary coding information of the control switch flag bit of the first target prediction mode;
and if the binary value of the control switch flag bit of the first target prediction mode is decoded to be the second value, executing the step of judging whether the current block meets the decoding-free condition of the flag bit of the mode to be decoded or not according to the specific information of the current block.
3. The method of claim 2, wherein before 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, the method further comprises:
before the binary coding information of the control switch flag bit of the second target prediction mode is decoded, acquiring and judging 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, skipping the step of decoding the binarization encoding information of the control switch flag bit of the second target prediction mode, and determining the binarization value of the control switch flag bit of the second target prediction mode as the first value;
if the current block does not meet the decoding-free condition of the second target prediction mode, executing the step of decoding the binary coding information of the control switch flag bit of the second target prediction mode;
and if the binary value of the control switch flag bit of the second target prediction mode is decoded to be the second value, executing the step of acquiring and judging 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 of claim 2, wherein the first target prediction mode is skip mode;
when the skip mode is enabled, the at least one prediction mode comprises one or more of a conventional skip mode, an Affine Affinie mode, an advanced motion vector expression mode UMVE mode, an angle weighted prediction mode AWP mode and an enhanced temporal motion vector prediction mode ETMVP mode.
5. The method of claim 4, wherein the decode-free condition of the first target prediction mode comprises one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is less than a first threshold.
6. The method according to claim 3, wherein the first target prediction mode is direct mode and the second target prediction mode is skip mode;
when the direct mode is enabled, the at least one prediction mode comprises one or more of a conventional direct mode, an InterPF mode, an affinity mode, a UMVE mode, an AWP mode and an ETMVP mode.
7. The method of claim 6, wherein the decode-free condition of the first target prediction mode comprises one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is smaller than a second threshold value;
the decode-free condition of the second target prediction mode comprises one or more of:
the current block uses a normal intra prediction mode, a block copy intra prediction mode, or a string copy intra prediction mode;
the sum of the width and the height of the current block is smaller than a third threshold value.
8. The method according to any of claims 1-7, wherein the decoding information whether it is available for any of the at least one prediction mode comprises one or more of switch state information, size information of the current block, and frame type information.
9. The method of claim 8, wherein for any prediction mode of the at least one prediction mode, determining whether the prediction mode is available based on decoding information about whether the prediction mode is available comprises:
determining whether the current block satisfies a constraint condition that the prediction mode is allowed to be enabled based on decoding information whether the prediction mode is available;
if yes, determining that the prediction mode is available; otherwise, determining that the prediction mode is unavailable;
when the prediction mode is the UMVE mode, the limitation condition for allowing the activation comprises that a sequence level switch of the UMVE mode is in an open state;
when the prediction mode is an AWP mode, the limitations that allow enabling include one or more of:
the sequence level switch of the AWP mode is in an open state, the product of the width and the height of the current block is larger than or equal to a first size threshold value, the width of the current block is smaller than or equal to a first width threshold value, the height of the current block is smaller than or equal to a first height threshold value, and the frame type of the frame to which the current block belongs is a B frame;
when the prediction mode is ETMVP mode, the allowable constraints include one or more of the following:
the sequence level switch of the ETMVP mode is in an open state, the width of the current block is greater than or equal to a second width threshold value, and the height of the current block is greater than or equal to a second height threshold value;
when the prediction mode is the affinity mode, the limitation conditions allowed to be enabled include one or more of the following:
the sequence level switch of the Affinine mode is in an open state, the width of the current block is greater than or equal to a third width threshold value, and the height of the current block is greater than or equal to a third height threshold value;
when the prediction mode is the inter pf mode, the allowable enabling constraints include one or more of the following;
the sequence level switch of the InterPF mode is in an open state, the product of the width and the height of the current block is greater than or equal to a second size threshold value, the width of the current block is less than or equal to a fourth width threshold value, and the height of the current block is less than or equal to a fourth height threshold value.
10. A prediction mode encoding method, comprising:
aiming at a current block, before writing binary coding information of a mode marking bit to be coded into a code stream, judging whether the current block meets a coding-free condition of the mode marking bit to be coded;
if the current block meets the coding-free condition of the mode marking bit to be coded, skipping the step of writing the binaryzation coding information of the mode marking bit to be coded into a code stream;
and if the current block does not meet the coding-free condition of the mode marking bit to be coded, writing the binary coding information of the mode marking bit to be coded into a code stream.
11. A decoding apparatus, comprising:
the judging unit is used for judging whether the current block meets the decoding-free condition of the mark bit of the mode to be decoded according to the specific information of the current block before the binary coding information of the mark bit of the mode to be decoded is decoded for the current block;
a decoding unit, configured to determine, according to the specific information, that a binary value of the to-be-decoded mode flag bit is a first value or a second value if the current block satisfies a decoding-free condition of the to-be-decoded mode flag bit;
the decoding unit is further configured to, if the current block does not satisfy the decoding-free condition of the mode flag bit to be decoded, read the binarization encoding information of the mode flag bit to be decoded, decode the encoding information, and determine that the binarization value of the mode flag bit to be decoded is a first value or a second value;
wherein the specific information includes a value of at least one obtained mode flag bit and/or decoding information whether at least one prediction mode is available.
12. An encoding apparatus, comprising:
the judging unit is used for judging whether the current block meets the coding-free condition of the mark bit of the mode to be coded before the binary coding information of the mark bit of the mode to be coded is written into the code stream aiming at the current block;
the coding unit is used for skipping the step of writing the binaryzation coding information of the mode marking bit to be coded into a code stream if the current block meets the coding-free condition of the mode marking bit to be coded;
and the coding unit is also used for writing the binaryzation coding information of the mode marking bit to be coded into a code stream if the current block does not meet the coding-free condition of the mode marking bit to be coded.
13. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being configured to execute the machine-executable instructions to implement the prediction mode decoding method of any one of claims 1 to 9 or the prediction mode encoding method of claim 10.
CN202011410497.6A 2020-12-04 2020-12-04 Prediction mode decoding and encoding method and device Pending CN114598878A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011410497.6A CN114598878A (en) 2020-12-04 2020-12-04 Prediction mode decoding and encoding method and device
CN202111673156.2A CN114339236B (en) 2020-12-04 2020-12-04 Prediction mode decoding method, electronic device and machine-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011410497.6A CN114598878A (en) 2020-12-04 2020-12-04 Prediction mode decoding and encoding method and device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202111673156.2A Division CN114339236B (en) 2020-12-04 2020-12-04 Prediction mode decoding method, electronic device and machine-readable storage medium

Publications (1)

Publication Number Publication Date
CN114598878A true CN114598878A (en) 2022-06-07

Family

ID=81073885

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202011410497.6A Pending CN114598878A (en) 2020-12-04 2020-12-04 Prediction mode decoding and encoding method and device
CN202111673156.2A Active CN114339236B (en) 2020-12-04 2020-12-04 Prediction mode decoding method, electronic device and machine-readable storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202111673156.2A Active CN114339236B (en) 2020-12-04 2020-12-04 Prediction mode decoding method, electronic device and machine-readable storage medium

Country Status (1)

Country Link
CN (2) CN114598878A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745600A (en) * 2022-06-10 2022-07-12 中国传媒大学 Video label labeling method and device based on SEI

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102319384B1 (en) * 2014-03-31 2021-10-29 인텔렉추얼디스커버리 주식회사 Method and apparatus for intra picture coding based on template matching
CN111385572B (en) * 2018-12-27 2023-06-02 华为技术有限公司 Prediction mode determining method and device, encoding device and decoding device
CN111698500B (en) * 2019-03-11 2022-03-01 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment
CN113411592B (en) * 2019-06-21 2022-03-29 杭州海康威视数字技术股份有限公司 Method and device for decoding and encoding prediction mode

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745600A (en) * 2022-06-10 2022-07-12 中国传媒大学 Video label labeling method and device based on SEI

Also Published As

Publication number Publication date
CN114339236A (en) 2022-04-12
CN114339236B (en) 2022-12-23

Similar Documents

Publication Publication Date Title
US11863714B2 (en) Method for constructing motion information candidate list, method and apparatus for triangle prediction decoding
TWI764012B (en) Extended reference intra-picture prediction
JP2018082466A (en) Picture coding supporting block partitioning and block merging
CN109644271A (en) The method and device of determination Candidate Set for binary tree segmentation block
CN111919449A (en) Video signal processing method and apparatus using motion compensation
US20060039476A1 (en) Methods for efficient implementation of skip/direct modes in digital video compression algorithms
CN115152227A (en) Selective switching of parallel processing
CN110024397B (en) Method and apparatus for encoding video
US20230300326A1 (en) Prediction methods
KR20210100123A (en) Inter prediction concept using tile independence constraints
CN113545088A (en) Method and apparatus for intra sub-partition coding mode
CN110832854B (en) Method and apparatus for intra prediction using interpolation
JP7311635B2 (en) Codec method, device and equipment therefor
CN114501019A (en) Partition prediction
JP7494403B2 (en) Decoding method, encoding method, apparatus, device and storage medium
EP3469793A1 (en) Devices and methods for video coding using segmentation based partitioning of video coding blocks
CN114339236B (en) Prediction mode decoding method, electronic device and machine-readable storage medium
CN115052161A (en) Inter-frame prediction method, encoder, decoder, and computer storage medium
CN113615195A (en) Intra block copy for screen content coding and decoding
CN112511835B (en) Video coding method based on HEVC
CN113453005B (en) Decoding method, encoding method, device and equipment
CN113545090A (en) Method and apparatus for intra sub-partition coding and decoding mode
JP5370899B2 (en) Moving picture decoding method and moving picture decoding apparatus
CN115955572A (en) Encoding method, decoding method, electronic device, and computer-readable storage medium
CN117941345A (en) Image decoding device, image decoding method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination