Coding method, decoding method, bitstream, coders, decoders and storage medium

By constructing a candidate list for sub-block merging and optimizing motion information, the problems of bitstream overhead and encoding complexity caused by sub-block merging mode are solved, thus improving video encoding and decoding efficiency.

WO2026007084A1PCT designated stage Publication Date: 2026-01-08GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/103694
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2026-01-08

AI Technical Summary

Technical Problem

In video coding standards, when the sub-block merging mode is used less frequently, it increases bitstream overhead and coding complexity, thus affecting compression efficiency.

Method used

By constructing a candidate list for sub-block merging, the motion information of the current block is determined, and the prediction value is optimized based on the motion information. This controls the bitstream overhead, reduces unnecessary syntax element transmission, and allows more blocks to use the sub-block merging mode.

Benefits of technology

The parsing conditions of syntax elements have been optimized, unnecessary transmissions have been reduced, encoding and decoding efficiency has been improved, more blocks can use the sub-block merging mode, and the transmission of motion models has been optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024103694_08012026_PF_FP_ABST
    Figure CN2024103694_08012026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a coding method, a decoding method, a bitstream, coders, decoders and a storage medium. Taking a decoding end as an example, the decoding method comprises: parsing a bitstream, and determining the value of a first syntax element of a current block; when the value of the first syntax element indicates that the current block uses a sub-block merge mode, constructing a sub-block merge candidate list for the current block; on the basis of the sub-block merge candidate list for the current block, determining motion information of sub-blocks of the current block; and on the basis of the motion information of the sub-blocks of the current block, determining predicted values of the sub-blocks of the current block. In this way, a parsing condition for the first syntax element is optimized to reduce unnecessary transmission of the first syntax element, which effectively controls the bitstream overhead and enables more blocks to use the sub-block merge mode, so that a motion model of a decoded block can be more easily transferred to a subsequent block, thereby optimizing the sub-block merge candidate list and improving the decoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Coding method, code stream, encoder, decoder and storage medium TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of video coding, in particular to a coding method, a code stream, an encoder, a decoder and a storage medium. BACKGROUND

[0002] Subblock Merge Mode is an inter prediction technology adopted in video coding standards, especially in H.266 / VVC (Versatile Video Coding). If the current block uses the subblock merge mode, a subblock merge candidate list needs to be constructed, and the motion information of each subblock of the current block is determined according to the subblock merge candidate list, and a prediction value is made by motion compensation according to the motion information.

[0003] At present, if the probability of a large number of coding blocks using the subblock merge mode is low, the introduction of the subblock merge mode will increase the overhead in the code stream, which is not conducive to compression efficiency, and will also increase the complexity of coding.

[0004] SUMMARY

[0005] The embodiments of the present application provide a coding method, a code stream, an encoder, a decoder and a storage medium, which reduce unnecessary transmission of a first syntax element, effectively control the code stream overhead, and improve the coding efficiency.

[0006] The technical solutions of the embodiments of the present application can be implemented as follows:

[0007] In a first aspect, the embodiments of the present application provide a decoding method applied to a decoder, and the method comprises:

[0008] parsing a code stream to determine a value of a first syntax element of a current block, the first syntax element being used to indicate whether the current block uses a subblock merge mode;

[0009] in a case where the value of the first syntax element indicates that the current block uses the subblock merge mode, constructing a subblock merge candidate list of the current block;

[0010] determining motion information of a subblock of the current block based on the subblock merge candidate list of the current block;

[0011] determining a prediction value of the subblock of the current block based on the motion information of the subblock of the current block.

[0012] In a second aspect, the embodiments of the present application provide an encoding method applied to an encoder, and the method comprises:

[0013] construct a subblock merge candidate list of the current block in a case that it is determined that the subblock merge mode is allowed to be used for the current block;

[0014] determine motion information of a subblock of the current block based on the subblock merge candidate list of the current block;

[0015] determine a prediction value of the subblock of the current block based on the motion information of the subblock of the current block;

[0016] make an encoding decision on the subblock merge mode based on the prediction value of the subblock of the current block, to determine a value of a first syntax element of the current block, the first syntax element being used to indicate whether the subblock merge mode is used for the current block;

[0017] encode the first syntax element of the current block, and write obtained encoding bits into a bitstream.

[0018] In a third aspect, an embodiment of the present application provides a bitstream, wherein the bitstream is generated by bit encoding to-be-encoded information; and the to-be-encoded information comprises at least one of the following: a first syntax element and an index value of a subblock merge candidate list; and the first syntax element is used to indicate whether a subblock merge mode is used for a current block.

[0019] In a fourth aspect, an embodiment of the present application provides an encoder, which comprises a first prediction unit, a first determination unit and an encoding unit; wherein

[0020] the first prediction unit is configured to construct a subblock merge candidate list of the current block in a case that it is determined that the subblock merge mode is allowed to be used for the current block; determine motion information of a subblock of the current block based on the subblock merge candidate list of the current block; and determine a prediction value of the subblock of the current block based on the motion information of the subblock of the current block;

[0021] the first determination unit is configured to make an encoding decision on the subblock merge mode based on the prediction value of the subblock of the current block, to determine a value of a first syntax element of the current block, the first syntax element being used to indicate whether the subblock merge mode is used for the current block;

[0022] the encoding unit is configured to encode the first syntax element of the current block, and write obtained encoding bits into a bitstream.

[0023] In a fifth aspect, an embodiment of the present application provides an encoder, which comprises a first memory and a first processor; wherein

[0024] the first memory is used to store a computer program capable of running on the first processor;

[0025] the first processor is used to execute the method in the second aspect when the computer program is running.

[0026] In a sixth aspect, an embodiment of the present application provides a decoder, the decoder comprising a decoding unit and a second prediction unit; wherein:

[0027] The decoding unit is configured to parse a code stream, and determine a value of a first syntax element of a current block, the first syntax element being used to indicate whether the current block uses a sub-block merge mode;

[0028] The second prediction unit is configured to, in a case where the value of the first syntax element indicates that the current block uses the sub-block merge mode, construct a sub-block merge candidate list of the current block, determine motion information of a sub-block of the current block based on the sub-block merge candidate list of the current block, and determine a prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block.

[0029] In a seventh aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein,

[0030] The second memory is configured to store a computer program capable of running on the second processor;

[0031] The second processor is configured to, when running the computer program, execute the method in the first aspect.

[0032] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a code stream generated by the encoding method.

[0033] In a ninth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed to implement the method in the first aspect, or the method in the second aspect.

[0034] An embodiment of the present application provides a coding method, a code stream, an encoder, a decoder and a storage medium. Taking the decoding end as an example, the method comprises the following steps: parsing a code stream, and determining a value of a first syntax element of a current block; in a case where the value of the first syntax element indicates that the current block uses a sub-block merge mode, constructing a sub-block merge candidate list of the current block; determining motion information of a sub-block of the current block based on the sub-block merge candidate list of the current block; and determining a prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block. In this way, the parsing condition of the first syntax element is optimized, unnecessary transmission of the first syntax element is reduced, the code stream overhead is effectively controlled, and more blocks can use the sub-block merge mode, so that the motion model of the decoded block is more easily passed to a subsequent block, the sub-block merge candidate list is optimized, and the decoding efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0035] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0036] FIG. 1 is a schematic diagram of a framework of an encoder according to an embodiment of the present application;

[0037] FIG. 2 is a schematic diagram of a structure of a classic GOP in a random access period;

[0038] FIG. 3 is a schematic diagram of block partitioning in HEVC;

[0039] FIG. 4 is a schematic diagram of positions of reference blocks in constructing a merge candidate list;

[0040] FIG. 5 is a schematic diagram of a positional relationship between a current picture and a reference picture;

[0041] FIG. 6 is a schematic diagram of constructing an Affine model using two control points;

[0042] FIG. 7 is a schematic diagram of constructing an Affine model using three control points;

[0043] FIG. 8 is a schematic diagram of deriving a motion vector based on sub-blocks in Affine;

[0044] FIG. 9 is a schematic diagram of positions of reference blocks of a current block;

[0045] FIG. 10 is a schematic diagram of positions of reference blocks of a current block;

[0046] FIG. 11 is a schematic diagram of temporal motion vector prediction based on sub-blocks;

[0047] FIG. 12 is a schematic diagram of a positional relationship between an encoding block and a neighboring block;

[0048] FIG. 13 is a schematic diagram of a network architecture of a coding system according to an embodiment of the present application;

[0049] FIG. 14 is a schematic diagram of a flow of a decoding method according to an embodiment of the present application;

[0050] FIG. 15 is a schematic diagram of positions of related blocks in a current picture according to an embodiment of the present application;

[0051] FIG. 16 is a schematic diagram of positions of related blocks in a reference picture according to an embodiment of the present application;

[0052] FIG. 17 is a schematic diagram of a search range of related blocks according to an embodiment of the present application;

[0053] FIG. 18 is a schematic diagram of a flow of an encoding method according to an embodiment of the present application;

[0054] FIG. 19 is a schematic diagram of a structure of an encoder according to an embodiment of the present application;

[0055] FIG. 20 is a schematic diagram of a specific hardware structure of an encoder according to an embodiment of the present application;

[0056] FIG. 21 is a schematic diagram of a structure of a decoder according to an embodiment of the present application;

[0057] FIG. 22 is a schematic diagram of a specific hardware structure of a decoder according to an embodiment of the present application;

[0058] FIG. 23 is a schematic diagram of a structure of a codec system according to an embodiment of the present application. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as would be understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the embodiments of the present application only and is not intended to limit the present application.

[0061] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0062] It should also be noted that the terms "first", "second", "third" in the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that "first", "second", "third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0063] In a video image, a coding block (CB) is generally represented by a first image component, a second image component and a third image component. The three image components are a luminance component, a blue chrominance component and a red chrominance component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V. Thus, the video image can be represented in YCbCr format or YUV format.

[0064] Before the embodiments of the present application are further described, the terms and names involved in the embodiments of the present application are explained, and the terms and names involved in the embodiments of the present application are applicable to the following explanations:

[0065] Moving Picture Experts Group (MPEG)

[0066] International Standardization Organization (ISO)

[0067] International Electrotechnical Commission (IEC)

[0068] Joint Video Experts Team (JVET)

[0069] Alliance for Open Media (AOM)

[0070] Next-generation video coding standard H.266 / Versatile Video Coding (VVC)

[0071] VVC Test Model (VTM)

[0072] Audio Video Standard (AVS)

[0073] High-Performance Model (HPM)

[0074] merge

[0075] skip

[0076] Coding Unit (CU)

[0077] Context-based Adaptive Variable-Length code (CAVLC)

[0078] Context-based Adaptive Binary Arithmetic Coding (CABAC)

[0079] It can be understood that digital video compression technology is mainly to compress huge digital image video data, so as to facilitate transmission and storage, etc. With the surge of Internet video and people's increasingly high requirements for video clarity, although the existing digital video compression standard can save a lot of video data, but at present, better digital video compression technology is still needed to reduce the bandwidth and traffic pressure of digital video transmission.

[0080] 1. Video coding framework

[0081] The current general video coding standard adopts a block-based hybrid coding framework. Each image or sub-image or frame in a video is divided into square maximum coding units (LCU) or coding tree units (CTU) of the same size (such as 256x256, 128x128, 64x64, etc.). Each maximum coding unit or coding tree unit can be divided into rectangular coding units (CU) according to rules. The coding unit can also be divided into prediction units (PU), transform units (TU), etc. Referring to FIG. 1, which shows a schematic diagram of the composition framework of an encoder, the hybrid coding framework includes prediction, transform, quantization, entropy coding, in loop filter, etc. The prediction module includes intra prediction and inter prediction. Inter prediction includes motion estimation and motion compensation. Since there is a strong correlation between adjacent pixels in a video image, the intra prediction method is used in video coding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent images in a video, the inter prediction method is used in video coding technology to eliminate the temporal redundancy between adjacent images, thereby improving the coding efficiency.

[0082] The basic process of a video codec is as follows. At the encoder side, a picture is divided into blocks, a prediction block for the current block is generated using intra prediction or inter prediction, the original block minus the prediction block to get a residual block, the residual block is transformed and quantized to get a quantized coefficient matrix, the quantized coefficient matrix is entropy coded and output to the bitstream. At the decoder side, a prediction block for the current block is generated using intra prediction or inter prediction, the quantized coefficient matrix is parsed from the bitstream and dequantized and inverse transformed to get a residual block, the prediction block and the residual block are added to get a reconstructed block. The reconstructed blocks form a reconstructed picture, the reconstructed picture is loop filtered to get a decoded picture based on picture or based on block. The encoder side also needs similar operations to get a decoded picture. The decoded picture can be used as a reference picture for the following pictures for inter prediction. The block partitioning information, prediction, transform, quantization, entropy coding, loop filtering and other mode information or parameter information if necessary need to be output to the bitstream. The decoder side parses and analyzes the information to determine the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering and other mode information or parameter information as the encoder side, so as to ensure that the decoded picture obtained by the encoder side is the same as the decoded picture obtained by the decoder side. The decoded picture obtained by the encoder side is usually also called a reconstructed picture. When predicting, the current block can be divided into prediction units, and when transforming, the current block can be divided into transform units. The division of the prediction units and the transform units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process can be optimized. The present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.

[0083] A current block (CB) can be a current coding unit (CU) or a current prediction unit (PU), etc. Due to the need for parallel processing, a picture can be divided into slices, etc., and slices in the same picture can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, which can generally be understood as a frame being an image. In this document, the frame can also be replaced by image or slice, etc.

[0084] 2. Inter prediction

[0085] Inter prediction utilizes the temporal correlation to eliminate redundancy. In order to make the human eye not to see the stutter, the frame rate of a general video will be 30 frames per second, 50 frames per second, 60 frames per second, or even 120 frames per second. In such a video, the correlation between adjacent frames under the same scene is very high, and the inter prediction technology utilizes this correlation to predict the content to be encoded by referring to the content of the already encoded frame. Inter prediction can greatly improve the encoding performance.

[0086] The most basic inter prediction method is translational prediction, which assumes that the content to be predicted in the current picture is translational motion between the current picture and the reference picture. For example, if the content of the current block (coding unit or prediction unit) is translational motion between the current picture and the reference picture, then the content can be found in the reference picture by a motion vector (MV) and used as the prediction block of the current block. Translational motion is a large proportion of video, such as static background, overall translational objects, and translational camera motion, which can be handled by translational prediction.

[0087] Some content in natural video is not simply translational, such as some subtle changes in the process of translation, including changes in shape, color, etc. Bi-prediction finds two reference blocks from the reference picture and performs weighted average of the two reference blocks to obtain a prediction block as similar as possible to the current block. For example, for some scenes, weighted average of a reference block from the front and a reference block from the back of the current frame can be more similar to the current block than a single reference block. Based on this, bi-prediction improves the compression performance on the basis of uni-prediction.

[0088] Picture Order Count (POC) can be used as an identifier of a picture. Each picture in a video sequence has a unique POC. In this paper, the order of POC is considered the same as the order of playing. A P picture (P Frame) is a picture that can only be predicted using reference pictures that have a POC before the current picture. A current picture has only one reference picture list, denoted as RPL0. RPL can be understood as the abbreviation of Reference Picture List. All the pictures in RPL0 have a POC before the current picture. A B picture (B Frame) is a picture that can be predicted using reference pictures that have a POC before the current picture and reference pictures that have a POC after the current picture. A B picture has two reference picture lists, denoted as RPL0 and RPL1. One configuration is that all the pictures in RPL0 have a POC before the current picture and all the pictures in RPL1 have a POC after the current picture. For a current block, it can only refer to a reference block in a picture in RPL0, which is also called forward prediction. It can only refer to a reference block in a picture in RPL1, which is also called backward prediction. It can refer to a reference block in a picture in RPL0 and a reference block in a picture in RPL1, which is also called bi-prediction. One simple way to do bi-prediction is to average the pixels in the corresponding positions of the two reference blocks to get the predicted block of the current block. Later, B picture is not limited to that all the pictures in RPL0 have a POC before the current picture and all the pictures in RPL1 have a POC after the current picture. So, there can be pictures in RPL0 that have a POC after the current picture and there can be pictures in RPL1 that have a POC before the current picture. A current block can refer to a reference picture that has a POC before the current picture or refer to a reference picture that has a POC after the current picture. This kind of B picture is also called generalized B picture.

[0089] The coding order of Random Access (RA) configuration is different from the order of POC. In this way, a B picture can refer to information before the current picture and information after the current picture, which significantly improves the coding performance. A classic group of pictures (GOP) structure of RA is shown in Fig. 2.

[0090] Figure 2 is a diagram showing the structure of a group of pictures, where the arrows indicate the reference relationship. The I picture does not need to reference any picture. After the I picture with POC 0 is decoded, the P picture with POC 4 is decoded, and the P picture with POC 4 can reference the I picture with POC 0. Then the B picture with POC 2 is decoded, and the B picture with POC 2 can reference the I picture with POC 0 and the P picture with POC 4.

[0091] The order of encoding and decoding of the Low Delay (LD) configuration is the same as the POC order. Therefore, the current picture can only reference the information before the current picture. The Low Delay configuration is further divided into Low Delay P and Low Delay B. The Low Delay P is the traditional Low Delay configuration. The typical structure is IPPP..., that is, an I picture is encoded and decoded first, and then all the pictures are P pictures. The typical structure of the Low Delay B is IBBB..., which is different from the Low Delay P in that each inter picture is a B picture, that is, two reference picture lists are used, and the current block can simultaneously reference the reference block of a picture in RPL0 and the reference block of a picture in RPL1.

[0092] Generally, the compression efficiency of the RA configuration is higher than that of the LD configuration, and the compression efficiency of the LDB configuration is higher than that of the LDP configuration. On the one hand, the bidirectional prediction can reference the information after the current picture, and on the other hand, the bidirectional prediction can reduce the prediction error through some techniques, such as weighted average.

[0093] A reference picture list of a current picture can have at most several reference pictures, such as 2, 3, or 4. When a current picture is encoded, how many reference pictures are in RPL0 and RPL1 is determined by a certain configuration or algorithm, which is not the focus of the present application. However, the same reference picture can be simultaneously present in RPL0 and RPL1. That is, the encoder and decoder allow the current block to simultaneously reference two reference blocks of the same reference picture.

[0094] The encoder and decoder usually use an index value index in the reference picture list to correspond to the reference picture. If the length of a reference picture list is 4, the index has four values 0, 1, 2, and 3. For example, the RPL0 of the current frame has four reference pictures with POC 5, 4, 3, and 0. The index 0 of RPL0 is the reference picture with POC 5, the index 1 of RPL0 is the reference picture with POC 4, the index 2 of RPL0 is the reference picture with POC 3, and the index 3 of RPL0 is the reference picture with POC 0.

[0095] 3. Motion information

[0096] Inter prediction uses motion information to represent "motion". The basic motion information contains the information of reference picture and the information of motion vector (MV). In order to use bi-prediction, a block naturally needs to find 2 reference blocks, so it needs 2 sets of information of reference picture and information of motion vector. Each set can be understood as a uni-prediction, and the combination of the 2 sets forms a bi-prediction. In implementation, uni-prediction and bi-prediction can use the same data structure, only the 2 sets of information of reference picture and information of motion vector of bi-prediction are valid, while one set of information of reference picture and information of motion vector of uni-prediction is invalid. The valid can also be said as "used", and the invalid can also be said as "not used".

[0097] VVC supports 2 reference picture lists, denoted as RPL0 and RPL1. For the bi-prediction described above, VVC uses the reference picture index refldxL0 corresponding to RPL0 and the motion vector mvL0 corresponding to RPL0, and the reference picture index refldxL1 corresponding to RPL1 and the motion vector mvL0 corresponding to RPL1. The reference picture index corresponding to RPL0 and the reference picture index corresponding to RPL1 here can be understood as the information of reference picture described above. VVC uses two flags to represent whether to use the motion information corresponding to RPL0 and whether to use the motion information corresponding to RPL1, denoted as predFlagL0 and predFlagL1 respectively. It can also be understood that predFlagL0 and predFlagL1 represent "whether valid" of the uni-prediction described above. Therefore, although the data structure of motion information is not explicitly mentioned in VVC, it uses the reference picture index corresponding to each reference picture list, the motion vector and the flag bit of "whether valid" to represent the motion information. In the standard text of VVC, motion information does not appear, but motion vector is used, and it can be considered that the reference picture index and the flag of whether to use the corresponding motion information are the appendages of the motion vector. In this paper, "motion information" is still used for convenience of description, but it should be understood that "motion vector" can also be used for description. "Motion information" can also be called "motion parameter".

[0098] For a two-dimensional image, a motion vector can be represented as (x, y), which is a horizontal component and a vertical component. Since video is represented by pixels, there is a distance between pixels. The motion of an object between two adjacent images may not always correspond to an integer pixel distance. For example, in a long shot video, the distance between two pixels is 1 meter on a long shot object, and the distance of the object between two frames is 0.5 meters. The motion vector of the integer pixel cannot well represent this scenario. Therefore, the motion vector can be sub-pixel level, such as 1 / 2 pixel precision, 1 / 4 pixel precision, 1 / 8 pixel precision, 1 / 16 pixel precision, to represent the motion more accurately. And the pixel value of the sub-pixel position in the reference image is obtained by interpolation.

[0099] The above-mentioned unidirectional prediction and bidirectional prediction in translational prediction are both block-based, such as coding units or prediction units. That is, a pixel matrix is taken as a unit for prediction. The most basic block is a rectangular block, such as a square and a rectangle. Video coding standards such as HEVC and VVC allow the encoder to determine the size and division method of the coding unit and the prediction unit according to the content of the video. The region with simple texture or motion tends to use a larger block, and the region with complex texture or motion tends to use a smaller block. The deeper the block division level, the more complex blocks can be divided, which are closer to the actual texture or motion. However, the overhead for representing these divisions is also larger. Motion information may also need to be transmitted in the code stream. Moreover, generally, the finer the block division, the larger the overhead of motion information.

[0100] The most original motion information representation method is to directly write the complete motion information. Later, experts found that motion vector prediction (MVP) and motion vector difference (MVD) can be used to represent the motion vector, that is, MV = MVP + MVD. The more accurate the MVP is, the smaller the MVD is, and the smaller the overhead in the code stream is.

[0101] 4. Merge mode

[0102] It can be understood that each inter-coded block needs a motion information. To simplify the problem, we assume that the CU partitioning is equal to the PU partitioning which is equal to the TU partitioning, that is, a coding unit has a prediction unit with the same size and position and a transform unit with the same size and position. In fact, as the CU partitioning is more flexible, VVC has a tendency to weaken the PUs and TUs compared with HEVC. The difference in one of the prediction, transformation, quantization, and entropy coding steps can lead to the partitioning of the CU. For example, the motion information of two regions is different, so the encoder can divide the two regions into different CUs. For another example, the motion information of two regions is the same or similar, but the residual characteristics are very different, so the encoder can also divide the two regions into different CUs. How to divide is determined according to the overall compression efficiency, and does not completely depend on a certain factor. Thus, the same object or region with the same or similar motion can be divided into different CUs.

[0103] FIG. 3 is a schematic diagram of block partitioning in HEVC, a diagram a has a rod moving in the direction indicated by the arrow, and the background region moves less. In diagram b, the block partitioning of HEVC is shown, and in diagram c, the boundaries of the blocks with the same motion information in diagram b are removed. It can be seen that many adjacent blocks use the same motion information. In this case, if the motion information is encoded separately for each block, it will be obviously wasted. As mentioned above, the complete motion information of VVC includes the reference image index of RPL0, the MV and the flag of whether to use, the reference image index of RPL1, the MV and the flag of whether to use. The basic principle of the merge mode is that the current block can inherit the motion information of the adjacent block, including the information of the reference image and the information of the motion vector.

[0104] The merge mode can construct a merge candidate list. If the current block uses the merge mode, an index can be used to indicate which motion information the current block merges, so that the complete motion information does not need to be encoded. When constructing the merge candidate list, the motion information of the spatially adjacent block of the current block, the motion information in the time domain, the motion information of the non-adjacent block in the spatial domain, the motion information of the non-adjacent block in the time domain, the history-based motion information, and the synthesized motion information can be added.

[0105] The spatial neighboring blocks refer to the blocks in the same picture that are adjacent to the current block, and the spatial non-neighboring blocks refer to the blocks in the same picture that are not adjacent to the current block. The temporal motion information and the motion information of the temporal non-neighboring blocks refer to the motion information of the collocated positions in the collocated reference picture. An example is shown in Fig. 4, where the middle dark block is the current block, the positions 1, 2, 3, 4, 5 are the positions of the spatial neighboring blocks used in the merge mode, and the other light gray positions are the positions of the spatial non-neighboring blocks used in the merge mode. The position 6 is the position used in the temporal motion information, and if the corresponding position in the lower right corner of the current block is not available, the corresponding position 6 in the center of the current block is used. The other pattern filled blocks are the positions used in the motion information of the temporal non-neighboring blocks. The temporal motion information is derived from the motion information in the corresponding positions in the collocated reference picture, and the detailed derivation method is described in the next section.

[0106] The history-based motion information is not related to the position, and the codec maintains a first-in-first-out motion information list. After encoding each block, the codec updates the list with the motion information of the block, and ensures that the updated motion information is not duplicated in the list. The history-based motion information is obtained from the list.

[0107] 5. Derivation of temporal motion information (vector)

[0108] The temporal motion information prediction is used as a supplement to the spatial motion information prediction. In general, the correlation of the neighboring regions in the same picture is stronger than the correlation of the regions in different pictures. However, there are some cases where the temporal motion information is more useful. For example, the current block and the neighboring blocks in the current picture belong to different objects, and they have completely different motions. However, the motion of the blocks in a reference picture that belong to the same object as the current block can provide better motion information prediction for the current block.

[0109] The motion vector of the collocated block in the collocated reference picture is from the collocated reference picture col_pic to the reference picture col_ref of the collocated block. For the current block, the motion vector it needs is from the current picture curr_pic to the reference picture curr_ref of the current block. Fig. 5 shows the position relationship between the current picture and the reference picture. Let the POC distance between col_pic and col_ref be td, and the POC distance between curr_pic and curr_ref be tb. Assuming that the motion from the collocated block to the current block is constant, the scaling ratio can be determined according to td and tb. Let the motion vector of the collocated block be (col_mv_x, col_mv_y), then the time domain motion vector prediction (tmvp_x, tmvp_y) can be derived as follows: tmvp_x = col_mv_x * tb / td, tmvp_y = col_mv_y * tb / td.

[0110] The collocated reference picture is a reference picture from which the current picture can find a reference block to generate a prediction value. On the other hand, the collocated reference picture retains its own motion information used for prediction, which is the motion information of the reference picture of a block in the collocated reference picture when the block is used for prediction. The current picture can obtain the time domain motion information by scaling the motion information of the collocated picture from the collocated reference picture. In VVC, a current picture can have multiple reference pictures, but only one collocated reference picture.

[0111] In VVC, the smallest unit of stored motion information in the collocated reference picture is 8x8. That is, each 8x8 sub-block stores a set of motion information. It can be understood that if the cost of hardware implementation is not considered, the collocated reference picture can also be achieved by using smaller units such as 4x4, or each pixel stores a set of motion information.

[0112] 6. Affine

[0113] The simplest and most commonly used translation motion is introduced above. In the real world, there are many forms of motion such as shrinking, enlarging, rotating, perspective of motion (perspective: objects close to the lens appear large, and objects far from the lens appear small), and many irregular motion forms. Affine can be used to represent more complex motion than translation. As shown in FIG. 6, affine uses a linear model to calculate the motion vector of each sub-block or each pixel in the current block according to the motion vector of 2 control points (4 parameters, a motion vector includes x, y 2 parameters). Or, as shown in FIG. 7, affine uses a linear model to calculate the motion vector of each sub-block or each pixel in the current block according to the motion vector of 3 control points (6 parameters).

[0114] For the 4-parameter affine model, the motion vector of the (x, y) position in the current block is derived as follows:

[0115] For the 6-parameter affine model, the motion vector of the (x, y) position in the current block is derived as follows:

[0116] wherein is the motion vector of the top-left corner control point of the current block, is the motion vector of the top-right corner control point of the current block, is the motion vector of the bottom-left corner control point of the current block. W is the width of the current block, and H is the height of the current block. The superscripts h and v represent the horizontal component and the vertical component of the mv.

[0117] In order to simplify the complexity of hardware implementation, affine used in VVC divides the current block into 4x4 sub-blocks, calculates an MV for each sub-block, and performs motion compensation. FIG. 8 is a schematic diagram of affine deriving motion vectors based on sub-blocks. It can be understood that, with the increasing of hardware processing capacity, affine can also be pixel-based processing. That is, a motion vector is derived for each pixel, and a pixel is motion compensated according to the motion vector.

[0118] Affine only needs a few control points to derive the respective motion vectors of each sub-block or each pixel, and it can achieve more fine prediction compared with motion compensation based on the whole block. And compared with dividing a finer CU, the overhead of affine is much smaller.

[0119] It can be understood that affine uses control points, whether 2 control points or 3 control points, to derive the motion vector of each sub-block or each pixel with a model. More generally, affine mode can be written as

[0120] Once the values of a, b, c, d and the mv of the top-left control point are determined, the motion vector of each sub-block or each pixel can be derived. For the 4-parameter affine model, the motion vector of each pixel can be derived as follows:

[0121] For the 6-parameter affine model, the motion vector of each pixel can be derived as follows:

[0122] More generally, once the values of a, b, c, d and the mv of a certain point are determined, the motion vector of each sub-block or each pixel can be derived.

[0123] In the equation, the coordinates of the reference point are (x base , y base ), the mv of the reference point is mv base , and the reference point can be any position in the current block or even a position outside the current block.

[0124] In the VVC standard, a, b, c, d are represented by variables dHorX, dVerX, dHorY, dVerY respectively.

[0125] Affine also has a merge mode, similar to the merge mode with translational motion, in the affine merge mode, the affine model of the current block can be constructed according to the affine models of the neighboring blocks around the current block. Specifically, the neighboring blocks around the current block are A0, A1, B0, B1, B2, etc. as shown in FIG. 9. Check whether the neighboring blocks around the current block use the affine mode, if a certain neighboring block uses the affine mode, the affine model of the current block can be determined according to the affine model of the neighboring block. More specifically, the motion vector of the control point of the current block can be derived according to the motion vector of the control point (CPMV, control point motion vector) of the neighboring block. The current block can also be said to inherit the affine model of the neighboring block, of course this is a colloquial expression.

[0126] Of course, in addition to the affine model that can inherit the neighboring block, it can also build an affine model by itself. In VVC, several candidate CPMVs can be determined, as shown in FIG. 10, CPMV0 is determined by the available motion vectors in B2, B3, A2, CPMV1 is determined by the available motion vectors in B0, B1, CPMV2 is determined by the available motion vectors in A0, A1, and CPMV3 is determined by the available motion vectors in T, where T represents the temporal motion information determined according to the position outside the lower right corner of the current block (assuming that the position of the upper left corner of the current block in the picture is (xCb, yCb), the width of the current block is W, and the height of the current block is H, then the position outside the lower right corner of the current block is (xCb+W, yCb+H)). The temporal motion information is obtained by scaling the motion information used by the block containing the position (xCb+W, yCb+H) on the co-located reference picture. The affine model of the current block can be constructed according to the combination of some of the candidate CPMVs. For example,

[0127] {CPMV0,CPMV1,CPMV2},

[0128] {CPMV0,CPMV1,CPMV3},

[0129] {CPMV0,CPMV2,CPMV3},

[0130] {CPMV1,CPMV2,CPMV3},

[0131] {CPMV0,CPMV1},

[0132] {CPMV0,CPMV2}

[0133] The combination of the above 4 groups of 3 control points can construct a 6-parameter affine model, and the combination of the following 2 groups of 2 control points can construct a 4-parameter affine model. The 6-parameter affine model of VVC is represented by {CPMV0,CPMV1,CPMV2}, and the other 3 cases can construct {CPMV0,CPMV1,CPMV2}. The 4-parameter affine model of VVC is represented by {CPMV0,CPMV1}, and {CPMV0,CPMV2} can construct {CPMV0,CPMV1}.

[0134] Let CPMVidx, where idx is 0, 1, 2, 3, the motion vector is The construction method of VVC is as follows:

[0135] Construct {CPMV0,CPMV1,CPMV2} from {CPMV0,CPMV1,CPMV3} where CPMV2 = CPMV3 + CPMV0 - CPMV1. Construct {CPMV0,CPMV1,CPMV2} from {CPMV0,CPMV2,CPMV3} where CPMV1 = CPMV3 + CPMV0 - CPMV2.

[0136] Construct {CPMV0,CPMV1,CPMV2} from {CPMV1,CPMV2,CPMV3} where CPMV0 = CPMV1 + CPMV2 - CPMV3. Construct {CPMV0,CPMV1} from {CPMV0,CPMV2} where

[0137] Each of the above derivation procedures brings the known control points into equations (1), (2). Let the top-left control point, corresponding to CPMV0, have coordinates (0, 0), the top-right control point, corresponding to CPMV1, have coordinates (W, 0), let the bottom-left control point, corresponding to CPMV2, have coordinates (0, H), and let the bottom-right control point, corresponding to CPMV3, have coordinates (W, H).

[0138] 7. Subblock-based temporal motion vector prediction (SBTMVP)

[0139] Subblock-based temporal motion vector prediction (SBTMVP) is introduced in VVC. The conventional TMVP is for the whole block, that is, the whole block shares the same MVP. SBTMVP is based on subblock, so SBTMVP can get an MVP for each subblock, or in other words, SBTMVP can not have the same MVP for all subblocks. This is the essential difference between SBTMVP and TMVP.

[0140] On the other hand, TMVP uses the position of the right-bottom corner of the current block or the position of the center of the current block to locate the collocated block, while SBTMVP finds a motion offset according to the motion of the surrounding blocks to determine the position. In VVC, if the block at position A1 refers to a collocated reference picture, the motion offset is set to the motion vector of the collocated reference picture used by A1. Otherwise, the motion offset is set to (0, 0). As shown in FIG. 11, the position is found according to the motion offset, and then the MVs in the “collocated block” corresponding to the position of each subblock are scaled to obtain the MVP of each subblock.

[0141] 8. Subblock merge mode

[0142] Both affine merge mode and SBTMVP (subblock based temporal motion vector prediction) mode are subblock-based merge modes. In VVC, both affine merge and SBTMVP are put into the subblock merge mode, which jointly build a subblock merge candidate list. An example of control syntax is shown in Table 1.

[0143] Table 1

[0144] general_merge_flag[x0][y0] indicates whether the current coding unit uses the information of neighboring blocks to derive the inter prediction parameters. That is, whether the current block uses the merge mode. The array indices x0, y0 represent the coordinates of the top-left luma sample of the current block relative to the top-left luma sample of the current picture.

[0145] If the value of general_merge_flag[x0][y0] is 1, the decoder parses merge_data(x0, y0, cbWidth, cbHeight, chType). An example of the syntax structure of merge_data is shown in Table 2.

[0146] Table 2

[0147] In merge_data, if MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8, the decoder needs to parse merge_subblock_flag. MaxNumSubblockMergeCand indicates the maximum possible number of subblock merge candidates. cbWidth represents the width of the current block, and cbHeight represents the height of the current block.

[0148] merge_subblock_flag[x0][y0] indicates whether the current coding unit uses the information of neighboring blocks to derive the subblock-based inter prediction parameters. That is, whether the current block uses the subblock merge mode. The array indices x0, y0 represent the coordinates of the top-left luma sample of the current block relative to the top-left luma sample of the current picture. If merge_subblock_flag[x0][y0] does not appear, it is derived to be 0.

[0149] If MaxNumSubblockMergeCand > 1, the decoder needs to parse merge_subblock_idx. merge_subblock_idx[x0][y0] indicates the index of the merge candidate used by the current block in the subblock merge candidate list. Where the array indices x0, y0 represent the coordinates of the top-left luma sample of the current block relative to the top-left luma sample of the current picture. If merge_subblock_idx[x0][y0] is not present, it is derived to be 0.

[0150] In the subblock merge candidate list of VVC, SBTMVP has only one candidate, and it is placed in the first position of the subblock merge list, followed by the candidate of the affine merge. If the current block uses the subblock merge mode, i.e. merge_subblock_flag[x0][y0] is 1, the decoder will build the subblock merge candidate list, select the corresponding candidate according to merge_subblock_idx[x0][y0] to determine the motion information of each subblock of the current block, and make a prediction value according to the motion information.

[0151] In VVC, the premise for the current block to use the subblock merge mode is MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8. The first condition MaxNumSubblockMergeCand > 0 is controlled by some high-level syntax, such as the syntax of the sequence parameter set, which controls the maximum number of subblock merge candidates for the current sequence, and the entire sequence will be executed according to this condition. The other two conditions cbWidth >= 8 && cbHeight >= 8 are the restriction conditions of the current block, and only when the width and height of the current block are greater than or equal to 8, merge_subblock_flag[x0][y0] will be parsed, that is, only when the width and height of the current block are greater than or equal to 8, the current block can use the subblock merge mode.

[0152] On the one hand, if the current block can use the subblock merge mode, it is possible to generate better prediction values, thereby reducing the residual or improving the quality of the decoded image. On the other hand, the current block can use the subblock merge mode means that the current block needs to parse a syntax element, such as merge_subblock_flag[x0][y0] in VVC to determine whether it uses the subblock merge mode. This will increase the overhead in the code stream, and if a large number of blocks have a very low probability of using the subblock merge mode, it is not conducive to compression efficiency to force a syntax element in the code stream.

[0153] In the sub-block merge candidate list construction, for the affine, the current block first checks whether the neighboring blocks at several specific positions around the current block use the affine mode. If a neighboring block uses the affine mode, the affine model or affine parameters of the neighboring block can be directly inherited and applied to the current block as a candidate. If there are more blocks around the current block using the affine mode, the current block has more candidates, and vice versa.

[0154] FIG. 12 is a schematic diagram of the position relationship between a coding block and neighboring blocks. As shown in FIG. 12, the size of the left block is 8*16, the size of the middle block is 4*16, and the size of the right block is 16*16. The first number represents the width and the second number represents the height. It is assumed that all the blocks follow the same affine motion, but the middle block does not meet the size limit of the sub-block merge mode and cannot use the affine merge. For the right block, although it can use the affine merge, it cannot inherit the affine model from the middle block. That is, the preceding blocks affect the following blocks if the preceding blocks do not use the affine. Conversely, if a block can use the sub-block merge mode, it can pass an affine model to the following coding block.

[0155] Based on this, the embodiment of the present application provides a coding method, which optimizes the parsing condition of the first syntax element, reduces unnecessary transmission of the first syntax element, effectively controls the code stream overhead, and enables more blocks to use the sub-block merge mode, so that the affine model of the decoded block is more easily passed to the subsequent block, optimizes the sub-block merge candidate list, and improves the coding efficiency.

[0156] Further, the embodiment of the present application also provides a network architecture of a coding system including an encoder and a decoder. FIG. 13 shows a schematic diagram of a network architecture of a coding system according to an embodiment of the present application. As shown in FIG. 13, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. The electronic devices can be various types of devices having a video coding function in the implementation process, for example, the electronic devices can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigation instrument, a digital telephone, a video telephone, a television, a sensing device, a server, etc., which are not limited specifically herein. In addition, the decoder or the encoder described in the embodiment of the present application can be the above-mentioned electronic devices.

[0157] It should be noted that the method of the embodiment of the present application is mainly applied to the inter prediction unit, and can be applied to the encoder or the decoder, or even applied to both the encoder and the decoder, but the embodiment of the present application is not limited specifically.

[0158] It should be noted that, when applied to the encoder, the "current block" specifically refers to an encoding block currently to be subjected to intra prediction; when applied to the decoder part, the "current block" specifically refers to a decoding block currently to be subjected to intra prediction.

[0159] To make the technical solution of the embodiments of the present application more comprehensible, the technical solution of the present application is described in detail below through specific embodiments. The above related technologies can be combined with the technical solution of the embodiments of the present application as optional solutions, which all belong to the protection scope of the embodiments of the present application. The embodiments of the present application include at least part of the following contents.

[0160] In an embodiment of the present application, referring to FIG. 14, a flowchart of a decoding method provided by the embodiments of the present application is shown.

[0161] As shown in FIG. 14, the method can include:

[0162] S101: parsing a code stream to determine a value of a first syntax element of a current block, the first syntax element being used to indicate whether the current block uses a sub-block merge mode;

[0163] The value of the first syntax element being a first numerical value is used to indicate that the current block uses the sub-block merge mode; the value of the first syntax element being a second numerical value is used to indicate that the current block does not use the sub-block merge mode. The first numerical value and the second numerical value are different. For example, the first numerical value can be 1, and the second numerical value can be 0.

[0164] In some embodiments, the first syntax element at least includes a block-level syntax element.

[0165] In some embodiments, the parsing of the code stream to determine the value of the first syntax element of the current block is performed when a parsing condition of the first syntax element of the current block is met. The decoder determines whether to decode the first syntax element by judging whether the parsing condition is met when decoding the current block. For the decoder, the parsing condition of the first syntax element can also be understood as a usage condition of the sub-block merge mode.

[0166] In some embodiments, the method can further include: determining a width and a height of the current block; and performing the parsing of the code stream to determine the value of the first syntax element of the current block when the width of the current block is greater than or equal to a first threshold value and the height of the current block is greater than or equal to a second threshold value; wherein the first threshold value and the second threshold value are equal or not equal.

[0167] That is, the parsing condition of the first syntax element of the current block includes a first size limit condition, and the first syntax element needs to be parsed only when the size of the current block satisfies the first size limit condition; when the size of the current block does not satisfy the first size limit condition, the first syntax element does not need to be parsed, or the judgment is based on other conditions in the parsing condition.

[0168] In some embodiments, the first threshold and the second threshold are equal. For example, the first threshold and the second threshold can be 8, that is, the first size limit condition of the current block includes cbWidth >= 8 && cbHeight >= 8, cbWidth represents the width of the current block, and cbHeight represents the height of the current block. The first threshold and the second threshold can also be 4, 16, etc.

[0169] In some embodiments, the first threshold and the second threshold are not equal. For example, the first threshold can be 4 and the second threshold can be 8, that is, the first size limit condition of the current block includes cbWidth >= 4 && cbHeight >= 8. The first threshold can be 8 and the second threshold can be 4, that is, the first size limit condition of the current block includes cbWidth >= 8 && cbHeight >= 4.

[0170] It should be noted that the first threshold and the second threshold can be fixed values, and the first threshold and the second threshold can also be configured according to actual needs, and the first threshold and the second threshold can also be adaptively selected according to actual needs.

[0171] In some embodiments, the method can further include: determining the width and height of the current block; and in a case where the product of the width and the height of the current block is greater than or equal to a third threshold, performing parsing of the code stream to determine the value of the first syntax element of the current block. The third threshold is used to limit the lower limit value of the product of the width and the height of the current block (which can also be understood as the number of pixels of the current block), and by limiting the product of the width and the height of the current block, more blocks can use the sub-block merge mode, thereby expanding the application range of the sub-block merge mode.

[0172] That is, the parsing condition of the first syntax element of the current block includes a second size limit condition, and the first syntax element needs to be parsed only when the size of the current block satisfies the second size limit condition; when the size of the current block does not satisfy the second size limit condition, the first syntax element does not need to be parsed, or the judgment is based on other conditions in the parsing condition.

[0173] In some embodiments, the third threshold value can be 64, i.e., the second size limit condition of the current block includes cbWidth*cbHeight>=64. Taking FIG. 12 as an example, if the size of the middle block is 4*16, the second size limit of the sub-block merge mode is met, the affine merge can be used. For the right block decoded subsequently, the affine merge can be used, and the affine model can be inherited from the middle block, so that more blocks similar to the middle block can use the sub-block merge mode.

[0174] In some embodiments, the third threshold value can be 32. That is, the second size limit condition of the current block includes cbWidth*cbHeight>=32. The sub-block merge mode is extended to blocks with smaller width-height products, so that more blocks can use the sub-block merge mode.

[0175] It should be noted that the third threshold value can also be a value less than 32, for example, the third threshold value is 16. The third threshold value can also be a value greater than 64, for example, the third threshold value can be 128. The third threshold value can also be a value greater than 32 and less than 64, for example, the third threshold value can be 48.

[0176] It should also be noted that the third threshold value can be a fixed value, and the third threshold value can also be configured according to actual needs, and the third threshold value can also be adaptively selected according to actual needs.

[0177] In some embodiments, the parsing condition of the first syntax element of the current block includes the first size limit condition and the second size limit condition. On the basis that the size of the current block meets the first size limit condition and the second size limit condition, the first syntax element needs to be parsed; otherwise, the first syntax element does not need to be parsed, or it is determined based on other conditions in the parsing condition.

[0178] That is, by setting two size limit conditions, the application scenario of the sub-block merge mode can be expanded. For example, the size limit condition of the current block includes cbWidth>=4&&cbHeight>=8&&(cbWidth*cbHeight)>=32.

[0179] In some embodiments, the method can further include: in a case where the value of the third variable of the current block indicates that the maximum number of sub-block merge candidate lists is greater than 0, performing parsing of the code stream to determine the value of the first syntax element of the current block.

[0180] That is, the parsing condition of the first syntax element of the current block also includes that the maximum number of sub-block merge candidate lists is greater than 0.

[0181] The value of the third variable can be controlled by some high level syntax, such as the syntax of sequence parameter set, which controls the maximum number of subblock merge candidates for the current sequence subblock merge mode. The maximum number of subblock merge candidates greater than 0 indicates that there is at least one candidate for the current sequence subblock merge mode, and the maximum number of subblock merge candidates equal to 0 or less than 0 indicates that the current sequence does not use subblock merge mode, and thus there is no need to parse the first syntax element. The maximum number of subblock merge candidates greater than 0 can be used as a prerequisite condition for parsing the first syntax element, in combination with any of the parsing conditions in the embodiments of the present application.

[0182] In some embodiments, the first syntax element is denoted as merge_subblock_flag, and the third variable is denoted as MaxNumSubblockMergeCand. The parsing of the first syntax element is shown in Table 3.

[0183] Table 3

[0184] Although 8*8 equals 64, such modification allows cbWidth or cbHeight to be 4, and blocks with (cbWidth*cbHeight)>=64 to use subblock merge mode, so that more blocks can use subblock merge mode. For example, blocks of 4*16, 4*32, 4*64, 16*4, 32*4, 64*4, etc.

[0185] If the hardware condition allows, the restriction can be further relaxed to allow smaller blocks to use subblock merge mode, as shown in Table 4.

[0186] Table 4

[0187] This allows blocks of 4*8 and 8*4 to also use subblock merge mode. Blocks of 4*8 and 8*4 include two 4*4 subblocks, and subblock merge mode can also be used to generate better prediction values. In addition, in motion complex areas, it is easier to divide small blocks, and allowing blocks of 4*8 and 8*4 to use subblock merge mode is beneficial to the transmission of affine model.

[0188] In some embodiments, the method can further include: obtaining prediction information used by one or more positions related to the current block; determining the value of the first variable of the current block based on the prediction information used by the one or more positions related to the current block; and determining whether to allow the parsing of the code stream to be performed based on the value of the first variable of the current block, and determining the value of the first syntax element of the current block.

[0189] The value of the first variable is used to indicate whether the first syntax element is allowed to be parsed for the current block, and can also be used to indicate whether the sub-block merge mode is allowed to be used for the current block, and the value of the first variable is determined according to the prediction information used by the position related to the current block.

[0190] The parsing condition of the first syntax element of the current block includes that the value of the first variable indicates that the first syntax element is allowed to be parsed. The value of the first variable is derived from the prediction information used by one or more positions related to the current block that have been decoded, and in addition, the value of the first variable can also be controlled by some high-level syntax, such as the syntax of the sequence parameter set, to control whether the first syntax element is allowed to be parsed for the current sequence.

[0191] The one or more positions related to the current block that have been decoded can be understood as positions in the decoded image region that have relevance to the current block, and can also be referred to as relevant positions. The prediction information of the relevant positions can be used as a reference for the current block to determine whether the first syntax element needs to be parsed.

[0192] In some embodiments, the relevant positions include adjacent positions of the current block in the current image, the relevant positions can also include non-adjacent positions of the current block in the current image, and the relevant positions can also include one or more relevant positions of the current block in the reference image.

[0193] In some embodiments, the one or more positions related to the current block include at least one of the following: one or more preset adjacent positions of the current block in the current image, one or more preset non-adjacent positions of the current block in the current image, and one or more preset relevant positions of the current block in the reference image.

[0194] In some embodiments, the one or more positions related to the current block include at least one of the following: relevant positions of the current block in a first range of the current image determined based on a first search rule, and one or more relevant positions of the current block in a second range of the reference image determined based on a second search rule.

[0195] For example, the first range can be the entire decoded region or part of the decoded region of the current image, and the second range can be the entire decoded region or part of the decoded region of the reference image. In some embodiments, the first range can include the upper region, the upper-left region, the left region, and the lower-left region of the current block in the current image. The second range can include the lower-right region of the collocated block in the reference image.

[0196] In some embodiments, the first search rule can be to search the first range based on a specific search step, and the second search rule can be to search the second range based on a specific search step.

[0197] In some embodiments, the first search rule can also be searching for a preset position in the first range, and the second search rule can also be searching for a preset position in the second range.

[0198] In some embodiments, based on the related position, a related block in which the related position is located is determined; and prediction information of the related block is obtained as the prediction information used by the related position. That is, when the prediction information of the decoded block is stored in units of blocks, the related position is used to locate the related block, so as to obtain the prediction information of the related block.

[0199] In some embodiments, based on the related position, the prediction information used by the related position is obtained. That is, when the prediction information of the decoded pixel is stored in units of pixels, the prediction information of the related position is directly obtained.

[0200] In some embodiments, the determination of the value of the first variable of the current block based on the prediction information used by one or more related positions of the current block comprises: in a case where the prediction information used by the one or more related positions of the current block satisfies a first condition, determining that the value of the first variable is a first value; and in a case where the prediction information used by the one or more related positions of the current block does not satisfy the first condition, determining that the value of the first variable is a second value.

[0201] In some embodiments, when the value of the first variable of the current block is the first value, it is determined that the parsing of the code stream is allowed to be performed, and the value of the first syntax element of the current block is determined; and when the value of the first variable of the current block is the second value, it is determined that the parsing of the code stream is not allowed to be performed, and the value of the first syntax element of the current block is determined. The first value and the second value are not equal. For example, the first value can be 1, and the second value can be 0.

[0202] The first condition is used as a judgment condition for whether the first syntax element is allowed to be parsed.

[0203] In some embodiments, the prediction information comprises a prediction mode identifier, and the first condition comprises determining, based on the prediction mode identifier, that the prediction mode used by at least one related position is a first prediction mode. The prediction mode identifier is used to indicate the prediction mode of the related position or the related block. When the prediction mode of the at least one related position or the related block is the first prediction mode, it is determined that the value of the first variable is the first value; otherwise, it is determined that the value of the first variable is the second value. By checking the related block or the related position, it is determined whether it uses a certain or certain specific mode, and then it is determined whether the first syntax element of the current block is parsed.

[0204] For example, the at least one relevant position can be determined by checking all relevant positions of the current block, or by checking relevant positions of the current block based on the first order. The first condition can also include that the number of relevant positions with the first prediction mode is greater than a first number threshold, which can be 0, or an integer greater than 0.

[0205] In some embodiments, the first prediction mode includes at least one of: a subblock merge mode, an affine merge mode, an inter affine mode, and a subblock based temporal motion vector prediction (SBTMVP) mode.

[0206] The subblock merge mode can include any one or more subblock-based merge modes. In some embodiments, the affine merge mode and the SBTMVP mode are both subblock-based merge modes, and in VVC, the affine merge mode and the SBTMVP mode are both placed in the subblock merge mode, i.e., the affine merge mode and the SBTMVP mode use merge_subblock_flag at the same time.

[0207] In some embodiments, the affine merge mode and the SBTMVP mode can also be used separately, and the decoding method provided by the embodiments of the present application can also be applied to the affine merge mode or the SBTMVP mode. The affine merge mode and the SBTMVP mode can be indicated by different syntax elements, for example, whether to use the affine merge mode is indicated by merge_subblock_flag1, and whether to use the SBTMVP mode is indicated by merge_subblock_flag2. By using the decoding method provided by the embodiments of the present application, it can be determined whether to parse merge_subblock_flag1 or merge_subblock_flag2 of the current block.

[0208] The inter affine mode is controlled by inter_affine_flag, and the inter affine mode needs to transmit the motion vector difference (MVD) of the control point in the code stream.

[0209] Exemplarily, in VVC, both affine merge and SBTMVP are in subblock merge mode, then it can be determined whether subblock merge mode and inter affine mode are used. For example, it can be determined by checking whether (merge_subblock_flag || inter_affine_flag) of the block or the position is at least one of 1. Or it can be determined by checking whether (MergeSubblockFlag || InterAffineFlag) of the block or the position is at least one of 1. MergeSubblockFlag of all positions in a block is equal to the value of merge_subblock_flag of the block; InterAffineFlag of all positions in a block is equal to the value of inter_affine_flag of the block.

[0210] The parsing condition includes that at least one of the block or the position needs to check whether a certain or certain specific mode is used, and it is determined that the first syntax element needs to be parsed for the current block. Exemplarily, (MergeSubblockFlag || InterAffineFlag) > 0, which uses subblock merge mode or inter affine mode, otherwise, it is not used.

[0211] In some embodiments, the prediction information includes a motion model identifier; the first condition can include determining that the motion model used by at least one related position is an affine model based on the motion model identifier. Exemplarily, the first condition can also include that the number of related positions using a radial model as the motion model is greater than a first number threshold, and the first number threshold can be 0, and the first number threshold can also be an integer greater than 0.

[0212] In some embodiments, the affine model includes at least one of: a 4-parameter based affine model and a 6-parameter based affine model.

[0213] Exemplarily, in VVC, MotionModelIdc[x][y] represents the motion model of a coding unit, as shown in Table 5, the array indexes x and y represent the luminance sample position (x, y) relative to the top-left luminance sample of the current picture.

[0214] Table 5

[0215] For all positions of the current block, i.e. x = x0..x0+cbWidth–1, y = y0..y0+cbHeight–1, where (x0, y0) is the coordinate of the top-left luminance sample of the current block relative to the top-left luminance sample of the current picture:

[0216] If general_merge_flag[ x0 ][ y0 ] is equal to 1, MotionModelIdc[ x ][ y ] = merge_subblock_flag[ x0 ][ y0 ]. After the specific candidate is selected in the subblock merge mode, MotionModelIdc[ x ][ y ] is updated according to the actually selected affine model. That is, if the actually selected candidate in the subblock merge mode is a 6-parameter affine model, MotionModelIdc[ x ][ y ] is updated to 2.

[0217] Otherwise (general_merge_flag[ x0 ][ y0 ] is equal to 0), MotionModelIdc[ x ][ y ] = inter_affine_flag[ x0 ][ y0 ] + cu_affine_type_flag[ x0 ][ y0 ].

[0218] inter_affine_flag[ x0 ][ y0 ] equal to 1 indicates that the current coding unit uses the motion compensation based on the affine model to generate the prediction value. inter_affine_flag[ x0 ][ y0 ] equal to 0 indicates that the current coding unit does not use the motion compensation based on the affine model to generate the prediction value.

[0219] cu_affine_type_flag[ x0 ][ y0 ] equal to 1 indicates that the current coding unit uses the motion compensation of the 6-parameter affine model to generate the prediction value. cu_affine_type_flag[ x0 ][ y0 ] equal to 0 indicates that the current coding unit uses the motion compensation of the 4-parameter affine model to generate the prediction value.

[0220] The parsing condition of the first syntax element of the current block includes that the motion model of at least one block or position to be checked is an affine model, and it is determined that the first syntax element of the current block needs to be parsed. For example, MotionModelIdc > 0, and the motion model thereof is an affine model, and MotionModelIdc <= 0, and the motion model thereof is not an affine model. More specifically, MotionModelIdc = 1 is a 4-parameter affine model, and MotionModelIdc = 2 is a 6-parameter affine model.

[0221] In some embodiments, the prediction information includes a prediction mode identifier and a motion model identifier; and the first condition can include that it is determined that the prediction mode used by the at least one related position is a first prediction mode based on the prediction mode identifier, or it is determined that the motion model used by the at least one related position is an affine model based on the motion model identifier.

[0222] The parsing condition of the first syntax element of the current block includes that at least one of the blocks or positions to be checked uses a certain or certain modes, or at least one of the blocks or positions to be checked has an affine model as the motion model, and it is determined that the current block needs to parse the first syntax element. That is, the prediction mode identifier and the motion model identifier can be checked at the same time, and as long as one of the two is satisfied, it is determined that the current block needs to parse the first syntax element; otherwise, it is determined that the current block does not need to parse the first syntax element.

[0223] In some embodiments, the method can further include: determining the width and height of the current block; and in a case where at least one of the following conditions is satisfied: the width of the current block is less than a fourth threshold value, the height of the current block is less than a fifth threshold value, and the product of the width and the height of the current block is less than a sixth threshold value, performing the parsing of the bitstream to determine the value of the first syntax element of the current block.

[0224] That is, the parsing condition of the first syntax element of the current block includes a third size limitation condition, and the first syntax element needs to be parsed only when the size of the current block satisfies the third size limitation condition; when the size of the current block does not satisfy the third size limitation condition, the first syntax element does not need to be parsed, or is determined based on other conditions in the parsing condition.

[0225] In some embodiments, the fourth threshold value and the fifth threshold value are equal. For example, the fourth threshold value and the fifth threshold value can be 8, that is, the third size limitation condition of the current block can include cbWidth < 8 || cbHeight < 8, or the third size limitation condition of the current block can include cbWidth < 8 && cbHeight < 8. The fourth threshold value and the fifth threshold value can also be 4, 16, etc. The decoding method provided in the embodiments of the present application can be applied to all blocks, or can be applied only to blocks in a certain size range.

[0226] In some embodiments, the fourth threshold value and the fifth threshold value are not equal. For example, the fourth threshold value can be 4 and the fifth threshold value can be 8, that is, the third size limitation condition of the current block includes cbWidth < 4 && cbHeight < 8.

[0227] The sixth threshold value is used to limit the upper limit value of the product of the width and the height of the current block (which can also be understood as the number of pixels of the current block), and by limiting the product of the width and the height of the current block, more blocks can use the sub-block merge mode, thereby expanding the application range of the sub-block merge mode.

[0228] In some embodiments, the sixth threshold value can be 64, and the sixth threshold value can be 32.

[0229] In some embodiments, the parsing condition of the first syntax element of the current block comprises that the width of the current block is less than a fourth threshold or the height of the current block is less than a fifth threshold, and the value of the first variable of the current block indicates that the first syntax element is allowed to be parsed. For example, a possible parsing condition can include (cbWidth < 8 || cbHeight < 8) && allowSubblockFlag.

[0230] In some embodiments, the product of the width and the height of the current block is less than a sixth threshold, and the value of the first variable of the current block indicates that the first syntax element is allowed to be parsed. For example, a possible parsing condition can include cbWidth * cbHeight < 64 && allowSubblockFlag. That is, for a block with a smaller size or a smaller number of pixels, the value of the first variable can be further combined to determine whether the first syntax element is parsed.

[0231] In some embodiments, for a block with a larger size or a larger number of pixels, the value of the first variable does not need to be combined to determine whether the first syntax element is parsed. In some embodiments, for a block with a larger size or a larger number of pixels, the value of the first variable can also be combined to determine whether the first syntax element is parsed.

[0232] S102: In the case where the value of the first syntax element indicates that the current block uses a sub-block merge mode, a sub-block merge candidate list of the current block is constructed;

[0233] The sub-block merge candidate list includes one or more candidates. For affine, the current block first checks whether the neighboring blocks at several specific positions around the current block use affine mode. If a neighboring block uses affine mode, the affine model or affine parameters of the neighboring block can be directly inherited and applied to the current block as a candidate. If there are more blocks around the current block that use affine mode, the current block has more candidates to choose from, and vice versa.

[0234] In the sub-block merge candidate list of VVC, the SBTMVP mode has only one candidate, which is placed at the first position of the sub-block merge list, followed by the candidates of affine merge. If the current block uses the sub-block merge mode, i.e., merge_subblock_flag[x0][y0] is 1, the decoder will construct a sub-block merge candidate list, select the corresponding candidate according to merge_subblock_idx[x0][y0] to determine the motion information of each sub-block of the current block, and perform motion compensation based on the motion information to obtain a prediction value.

[0235] S103: Based on the sub-block merge candidate list of the current block, motion information of sub-blocks of the current block is determined;

[0236] In some embodiments, the method further comprises: parsing the bitstream to determine an index value of the subblock merge candidate list of the current block, in a case that the value of the first syntax element indicates that the subblock merge mode is used for the current block, and the value of the third variable indicates that the maximum number of candidates of the subblock merge candidate list is greater than 1.

[0237] Correspondingly, determining the motion information of the subblock of the current block based on the subblock merge candidate list of the current block comprises: determining the motion information of the subblock of the current block based on the index value of the subblock merge candidate list of the current block and the subblock merge candidate list.

[0238] That is, in a case that the value of the first syntax element indicates that the subblock merge mode is used, and the maximum number of candidates indicated by the third variable is greater than 1, the decoder needs to parse the index value of the subblock merge candidate list. Illustratively, the syntax element merge_subblock_idx is determined by parsing the bitstream, and the index value of the subblock merge candidate list is determined according to the merge_subblock_idx. The merge_subblock_idx can directly represent the index value, or can indirectly represent the index reference value to save encoding bits. For example, the merge_subblock_idx represents the index value minus 1.

[0239] S104: determining the prediction value of the subblock of the current block based on the motion information of the subblock of the current block.

[0240] In some embodiments, the method further comprises: parsing the bitstream to determine the residual value of the subblock of the current block, and determining the reconstructed value of the subblock of the current block based on the residual value and the prediction value of the subblock of the current block.

[0241] In some embodiments, the method can further comprise: obtaining the prediction information used by one or more positions related to the current block; determining a context index value of the first syntax element of the current block based on the prediction information used by the one or more positions related to the current block; determining a context of the first syntax element based on the context index value; and parsing the bitstream to determine the value of the first syntax element of the current block based on the context of the first syntax element.

[0242] The context index value is used to index the context (also referred to as context model or context probability model) of the first syntax element. The context of the first syntax element is used to represent the probability of the value of the first syntax element being 0 or 1. Specifically, the bitstream is entropy decoded based on the context of the first syntax element to determine the value of the first syntax element.

[0243] In modern coding standards, such as VVC, CABAC (Context-based Adaptive Binary Arithmetic Coding) is usually used to improve the compression efficiency. For a syntax element like merge_subblock_flag, its possible values are just 0 and 1, which can be represented by a binary symbol. The context model is to estimate the probability of merge_subblock_flag being 0 or 1 for the current block using the context information. The more accurate the probability estimation is, the higher the compression efficiency is.

[0244] Decoded one or more positions related to the current block can be understood as positions in the decoded image region that have relevance to the current block, which can also be referred to simply as relevant positions. The prediction information of the relevant positions can be used as a reference for the current block to determine whether the first syntax element needs to be parsed.

[0245] In some embodiments, the relevant positions include neighboring positions of the current block in the current image. The relevant positions can also include non-neighboring positions of the current block in the current image. The relevant positions can also include one or more relevant positions of the current block in the reference image.

[0246] In some embodiments, the relevant positions include neighboring positions of the current block in the current image. The relevant positions can also include non-neighboring positions of the current block in the current image. The relevant positions can also include one or more relevant positions of the current block in the reference image.

[0247] In some embodiments, the one or more positions related to the current block include at least one of the following: one or more preset neighboring positions of the current block in the current image, one or more preset non-neighboring positions of the current block in the current image, and one or more preset relevant positions of the current block in the reference image.

[0248] In some embodiments, the one or more positions related to the current block include at least one of the following: a relevant position of the current block in a first range of the current image determined based on a first search rule, and one or more relevant positions of the current block in a second range of the reference image determined based on a second search rule.

[0249] For example, the first range can be the entire decoded region or part of the decoded region of the current image, and the second range can be the entire decoded region or part of the decoded region of the reference image. In some embodiments, the first range can include the upper region, the upper-left region, the left region, and the lower-left region of the current block in the current image. The second range can include the lower-right region of the collocated block in the reference image.

[0250] In some embodiments, the first search rule can be searching the first range based on a specific search step, and the second search rule can be searching the second range based on the specific search step.

[0251] In some embodiments, the first search rule can also be searching a preset position in the first range, and the second search rule can also be searching a preset position in the second range.

[0252] In some embodiments, based on the related position, a related block in which the related position is located is determined, and prediction information of the related block is obtained as prediction information used by the related position. That is, when the prediction information of the decoded block is stored in units of blocks, the related position is used to locate the related block, so as to obtain the prediction information of the related block.

[0253] In some embodiments, based on the related position, the prediction information used by the related position is obtained. That is, when the prediction information of the decoded pixel is stored in units of pixels, the prediction information of the related position is directly obtained.

[0254] It should be noted that the related position used to determine the value of the first variable of the current block can be the same as or at least partially different from the related position used to determine the context index value of the first syntax element of the current block.

[0255] In some embodiments, in a case where the prediction information used by the related position satisfies a second condition, the related value of the related position is determined as a third numerical value; in a case where the prediction information used by the related position does not satisfy the second condition, the related value of the related position is determined as a fourth numerical value; based on one or more related values of the related position of the current block, a value of a second variable of the current block is determined; and based on the value of the second variable of the current block, a context index value of the first syntax element of the current block is determined.

[0256] In some embodiments, the third numerical value can be 1, and the fourth numerical value can be 0.

[0257] In some embodiments, the prediction information includes a prediction mode identifier, and the second condition includes that the prediction mode identifier of the related position indicates that the prediction mode of the related position is a first prediction mode.

[0258] In some embodiments, the prediction information includes a motion model identifier, and the second condition includes that the motion model identifier of the related position indicates that the motion model of the related position is an affine model.

[0259] In some embodiments, the prediction information includes a prediction mode identifier and a motion model identifier, and the second condition includes that the prediction mode identifier of the related position indicates that the prediction mode of the related position is a first prediction mode, or the motion model identifier of the related position indicates that the motion model of the related position is an affine model.

[0260] In some embodiments, determining the value of the second variable of the current block based on the one or more correlation values of the positions related to the current block comprises: determining the value of the second variable of the current block based on the one or more correlation values of the positions related to the current block and a weight value. The weight value is related to the correlation between the positions and the current block, for example, the weight value is related to the distance between the positions and the current block, the smaller the distance, the larger the weight value, and vice versa. Through the weighted operation, the accuracy of the value of the second variable can be improved.

[0261] In some embodiments, the value of the second variable of the current block is taken as the context index value of the first syntax element of the current block. The value of the second variable of the current block is mapped to the context index value based on a preset mapping relationship. The mapping relationship can be a preset function relationship or a preset corresponding relationship.

[0262] In some embodiments, in VVC, merge_subblock_flag has 3 context models, and the one or more positions related to the current block include the left and top neighboring blocks of the current block. If neither of the two blocks uses the first prediction mode, the value of the second variable is 0, and the context model with index 0 is selected. If only one of the two blocks uses the first prediction mode, the value of the second variable is 1, and the context model with index 1 is selected. If both of the two blocks use the first prediction mode, the value of the second variable is 2, and the context model with index 2 is selected.

[0263] In some embodiments, determining the context index value of the first syntax element of the current block according to the value of the second variable of the current block comprises: when the value of the second variable is less than or equal to a seventh threshold value, determining the context index value as a first index value; when the value of the second variable is greater than the seventh threshold value and less than or equal to an eighth threshold value, determining the context index value as a second index value; and when the value of the second variable is greater than the eighth threshold value, determining the context index value as a third index value. That is, the value of the second variable can be mapped to the context index value based on the corresponding relationship defined by the seventh threshold value and the eighth threshold value, and the corresponding context model is further determined.

[0264] For example, let the second variable be denoted as cnt. Check all the blocks (or positions) that need to be checked. For each block (or position) that needs to be checked, if it uses a certain or certain specific mode, or its (MergeSubblockFlag || InterAffineFlag) > 0, or its MotionModelldc > 0, cnt = cnt + 1.

[0265] The context model is determined according to the value of cnt, such as

[0266] If 0 <= cnt <= THR1, the context model with index 0 is selected.

[0267] Otherwise if THR1 < cnt <= THR2, the context model with index 1 is selected.

[0268] Otherwise, THR2 < cnt, the context model with index 2 is selected.

[0269] With the technical solution, the parsing condition of the first syntax element is optimized, unnecessary transmission of the first syntax element is reduced, the code stream overhead is effectively controlled, more blocks can use the sub-block merge mode, the affine model of the decoded block is more easily transmitted to subsequent blocks, the sub-block merge candidate list is optimized, and the decoding efficiency is improved.

[0270] Further, based on the prediction information of one or more related positions related to the current block, it is determined whether the first syntax element needs to be parsed, unnecessary transmission of the first syntax element is reduced, and the decoding efficiency is improved.

[0271] Further, by adjusting the limitation condition of the block size, more blocks can use the sub-block merge mode, specifically, the strip block and the small size block can also use the sub-block merge mode, the affine model of the decoded block is more easily transmitted to subsequent blocks, and the sub-block merge candidate list is optimized.

[0272] The following further illustrates the process of determining the value of the first variable (allowSubblockFlag) according to the prediction information of some related blocks or related positions, and determining whether the first syntax element merge_subblock_flag needs to be parsed according to the value of the first variable, which is related to the embodiments of the present application.

[0273] It can be understood that in a video, the most common motion is translation motion, and the translation motion will not use the sub-block merge mode in most cases. Considering that the current block is in a region of translation motion, the possibility of using the sub-block merge mode is small. If the current block is in a region of rotation, scaling or other motion, the possibility of using the sub-block merge mode is large. That is, for the sub-block merge mode, especially the affine, the periphery of the current block is in what kind of motion has a great influence on the current block. Whether the current block needs to parse merge_subblock_flag can be determined according to the information of some related blocks or related positions. In this way, unnecessary code stream overhead can be reduced. For the decoder, unnecessary parsing operations are reduced, and the decoding efficiency is improved.

[0274] Method one for selecting related blocks

[0275] merge_subblock_flag is determined based on information of neighboring blocks of the current block, non-neighboring blocks on the current picture, and related blocks on the reference picture.

[0276] The neighboring blocks are blocks that are located adjacent to the current block, or blocks that contain positions adjacent to the current block. As shown in FIG. 10, the neighboring blocks can include A0, A1, A2, B0, B1, B2, and B3 blocks. If a top-left corner of the current block relative to a top-left corner of the current picture is (xCb, yCb), a width of the current block is cbWidth, and a height of the current block is cbHeight.

[0277] A0 is a block in the current picture containing (xCb-1, yCb+cbHeight),

[0278] A1 is a block in the current picture containing (xCb-1, yCb+cbHeight-1),

[0279] A0 is a block in the current picture containing (xCb-1, yCb),

[0280] B0 is a block in the current picture containing (xCb+cbWidth, yCb-1),

[0281] B1 is a block in the current picture containing (xCb+cbWidth-1, yCb-1),

[0282] B2 is a block in the current picture containing (xCb-1, yCb-1),

[0283] B3 is a block in the current picture containing (xCb, yCb-1).

[0284] The non-neighboring blocks on the current picture are blocks that are not located adjacent to the current block, or blocks that do not contain positions adjacent to the current block. As shown in FIG. 15, blocks 8 to 25.

[0285] If a top-left corner of the current block relative to a top-left corner of the current picture is (xCb, yCb), a width of the current block is cbWidth, and a height of the current block is cbHeight.

[0286] The block numbered 8 is a block in the current picture containing (xCb-cbWidth-1, yCb-cbHeight-1),

[0287] The block numbered 11 is a block in the current picture containing (xCb-2*cbWidth-1, yCb-2*cbHeight-1),

[0288] The block numbered 16 is the block of the current image containing the coordinates (xCb-3*cbWidth-1, yCb-3*cbHeight-1),

[0289] The block numbered 21 is the block of the current image containing the coordinates (xCb-4*cbWidth-1, yCb-4*cbHeight-1),

[0290] The block numbered 9 is the block of the current image containing the coordinates (xCb+2*cbWidth-1, yCb-cbHeight-1),

[0291] The block numbered 13 is the block of the current image containing the coordinates (xCb+3*cbWidth-1, yCb-2*cbHeight-1),

[0292] The block numbered 18 is the block of the current image containing the coordinates (xCb+4*cbWidth-1, yCb-3*cbHeight-1),

[0293] The block numbered 23 is the block of the current image containing the coordinates (xCb+5*cbWidth-1, yCb-4*cbHeight-1),

[0294] The block numbered 10 is the block of the current image containing the coordinates (xCb-cbWidth-1, yCb+2*cbHeight-1),

[0295] The block numbered 15 is the block of the current image containing the coordinates (xCb-2*cbWidth-1, yCb+3*cbHeight-1),

[0296] The block numbered 20 is the block of the current image containing the coordinates (xCb-3*cbWidth-1, yCb+4*cbHeight-1),

[0297] The block numbered 25 is the block of the current image containing the coordinates (xCb-4*cbWidth-1, yCb+5*cbHeight-1),

[0298] The block numbered 12 is the block of the current image containing the coordinates (xCb+cbWidth / 2, yCb-2*cbHeight-1),

[0299] The block numbered 17 is the block of the current image containing the coordinates (xCb+cbWidth / 2, yCb-3*cbHeight-1),

[0300] The block numbered 22 is the block in the current picture containing the coordinates (xCb+cbWidth / 2, yCb-4*cbHeight-1),

[0301] The block numbered 14 is the block in the current picture containing the coordinates (xCb-2*cbWidth-1, yCb+cbHeight / 2),

[0302] The block numbered 19 is the block in the current picture containing the coordinates (xCb-3*cbWidth-1, yCb+cbHeight / 2),

[0303] The block numbered 24 is the block in the current picture containing the coordinates (xCb-4*cbWidth-1, yCb+cbHeight / 2),

[0304] According to the above example, the coordinates of the non-adjacent blocks can be calculated according to (xCb, yCb), cbWidth, and cbHeight. Of course, the present solution is not limited to using the non-adjacent blocks positioned according to the above rules. It is also not limited to checking in the above order.

[0305] An example of a block on a reference picture is T in FIG. 10, i.e., the block in a certain reference picture containing the coordinates (xCb+cbWidth, yCb+cbHeight). The reference picture can be determined according to a certain preset rule, such as the picture with the reference picture index of 0 in RPL0, or can be specified by the encoder. Of course, in addition to the position of T, it can also be a block as shown in FIG. 16. The positioning method is similar to the above method, and will not be described here. It can be understood that the reference picture has been completely decoded, and all the blocks on the reference picture can be used to extract information. For example, we can also determine the blocks on the reference picture containing the coordinates 0-25 used above.

[0306] In some embodiments, whether the current block needs to parse merge_subblock_flag can be determined according to the information of the adjacent blocks.

[0307] In some embodiments, whether the current block needs to parse merge_subblock_flag can be determined according to the information of the adjacent blocks and the non-adjacent blocks on the current picture.

[0308] In some embodiments, whether the current block needs to parse merge_subblock_flag can be determined according to the information of the adjacent blocks, the non-adjacent blocks on the current picture, and the blocks on the reference picture.

[0309] The actually selected adjacent blocks, the non-adjacent blocks on the current picture, and the blocks on the reference picture can be different from those shown in the figures, such as different specific positions, sizes, and quantities.

[0310] Method two for selecting the relevant block

[0311] Based on the position of the current block, and the width and height of the current block, a first range of the current image is determined. For example, the position of the top-left corner of the current block is set as (xCb, yCb), the width of the current block is cbWidth, and the height of the current block is cbHeight. The first range can be set according to the position of the current block and cbWidth and cbHeight.

[0312] One possible range is shown in FIG. 17, where the dark gray block is the current block, and the range is all the decoded blocks in the rectangular region with the top-left corner at (xCb-2*cbWidth, yCb-2*cbHeight) and the right-top corner at (xCb+3*cbWidth-1, yCb-2*cbHeight) and the left-bottom corner at (xCb-2*cbWidth, yCb+3*cbHeight-1). If the minimum size of the CU or PU is 4x4, then all the 4x4 blocks in the search range can be counted, for example, the first 4x4 block in the top-left corner is the block containing the coordinate (xCb-2*cbWidth, yCb-2*cbHeight), and the horizontal direction is added by 4, and all the 4x4 blocks in the same row can be scanned, and the vertical direction is added by 4, and all the columns can be scanned. The block containing a coordinate refers to the CU or PU containing the coordinate. After the CU or PU containing the coordinate is determined, the intra prediction mode of the CU or PU can be found.

[0313] In some embodiments, the first range of the current image is determined based on the position of the current block, and at least one of the preset height and width of the first range. It can be understood that the position of the current block and a fixed width or height can be used to set the range, and one possible range is all the coded blocks in the rectangular region with the top-left corner at (xCb-64, yCb-64) and the right-top corner at (xCb+64, yCb-64) and the left-bottom corner at (xCb-64, yCb+64).

[0314] In some embodiments, the first range of the current image is determined based on the position of the current block, the width and height of the current block, and the preset height and width of the first range. It can be understood that the position of the current block, the width and height of the current block, and a fixed width or height can be used to set the range, and one possible range is all the coded blocks in the rectangular region with the top-left corner at (xCb-64, yCb-64) and the right-top corner at (xCb+cbWidth+64, yCb-64) and the left-bottom corner at (xCb-64, yCb+cuHeight+64).

[0315] That is, a first range matching the current block can be determined according to the position, width, height of the current block and preset parameters, so as to locate the block or position related to the height of the current block.

[0316] In some embodiments, the method further comprises one of the following: determining the second range of the reference image for the current block based on the position of the collocated block of the current block in the reference image, and the width and height of the collocated block of the current block; determining the second range of the reference image for the current block based on the position of the collocated block of the current block, and the preset height and width of the second range; determining the second range of the reference image for the current block based on the position of the collocated block of the current block, the width and height of the collocated block of the current block, and the preset height and width of the second range. The specific positioning method of the second range can refer to the first range.

[0317] That is, a second range matching the current block can be determined according to the position, size of the collocated block of the current block and preset parameters, so as to locate the block or position related to the height of the current block.

[0318] It should be noted that if some variables such as MergeSubblockFlag, InterAffineFlag, MotionModelIdc, etc. are provided for each position, then the position of the located block can be directly used to determine whether the current block needs to parse merge_subblock_flag.

[0319] The position can be represented by coordinates, such as (x, y), where x represents the horizontal coordinate or horizontal coordinate of the position, and y represents the vertical coordinate or vertical coordinate of the position. If the variable is provided for each position, it can be represented by a two-dimensional array, such as MergeSubblockFlag[][], so the value of MergeSubblockFlag corresponding to the position (x, y) is MergeSubblockFlag[x][y]. It should be noted that this is only one form of representation of these variables, and other forms of representation can also be used.

[0320] Judgment method

[0321] Check the prediction information of the related block to determine the value of the first variable (allowSubblockFlag).

[0322] One possible method is to determine whether a certain or certain ones of the modes are used by each block to be checked, and then determine the value of the first variable, such as affine mode, which includes affine merge in this context, and inter affine mode in VVC, which requires the transmission of the MVD (motion vector difference) of the control point in the code stream. The certain or certain ones of the modes can also include SBTMVP mode.

[0323] In VVC, both affine merge and SBTMVP are in subblock merge mode, so it can also be determined whether subblock merge mode and inter affine mode are used. For example, it is determined whether merge_subblock_flag and inter_affine_flag of the block to be checked are at least one of 1. Or it is determined whether MergeSubblockFlag and InterAffineFlag of the block to be checked are at least one of 1. MergeSubblockFlag of all positions in a block is equal to the value of its merge_subblock_flag; InterAffineFlag of all positions in a block is equal to the value of its inter_affine_flag.

[0324] In addition to determining whether a certain or certain ones of the modes are used, the motion model identifier MotionModelIdc can also be determined. In VVC, MotionModelIdc[x][y] represents the motion model of a coding unit, as shown in Table 5, and array indices x and y represent the position of the luminance sample (x, y) relative to the top left corner of the current image.

[0325] If at least one of the blocks to be checked uses a certain or certain ones of the modes, or (MergeSubblockFlag || InterAffineFlag) > 0, or MotionModelIdc > 0, it is determined that the current block needs to parse merge_subblock_flag.

[0326] Otherwise, i.e. none of the blocks to be checked uses a certain or certain ones of the modes, or (MergeSubblockFlag || InterAffineFlag) > 0, or MotionModelIdc > 0, it is determined that the current block does not need to parse merge_subblock_flag.

[0327] In a specific implementation, if the blocks are checked serially, or the blocks are checked in batches, the process can be exited early when it is determined that at least one of the blocks to be checked uses a certain or certain certain patterns, or (MergeSubblockFlag || InterAffineFlag) > 0, or MotionModelldc > 0.

[0328] Another possible method is to determine, for each block to be checked, whether it uses a certain or certain certain patterns, or (MergeSubblockFlag || InterAffineFlag) > 0, or MotionModelldc > 0, or certain or certain certain patterns are as above. Count the number of blocks that use a certain or certain certain patterns, or (MergeSubblockFlag || InterAffineFlag) > 0, or MotionModelldc > 0, and if this number reaches or exceeds a threshold, such as 2. Then determine that the merge_subblock_flag needs to be parsed. Otherwise, that is, the number does not reach or exceed the threshold, determine that the current block does not need to parse the merge_subblock_flag.

[0329] It should be noted that if some variables such as MergeSubblockFlag, InterAffineFlag, MotionModelldc, etc. are available at each location, then the current block can be directly determined according to the relevant location of the current block whether the current block needs to parse the merge_subblock_flag.

[0330] Method one for selecting relevant positions

[0331] The current block can be determined whether it needs to parse the merge_subblock_flag according to the information of the adjacent positions of the current block on the current image, the information of the non-adjacent positions on the current image, and the information of the positions on the reference image.

[0332] Adjacent positions are positions whose horizontal or vertical coordinates differ by 1 from the coordinates within the current block. If the top-left corner of the current block relative to the top-left corner of the current image is (xCb, yCb), the width of the current block is cbWidth, and the height of the current block is cbHeight. Adjacent positions can be (xCb-1, yCb+cbHeight), (xCb-1, yCb+cbHeight-1), (xCb-1, yCb), (xCb+cbWidth, yCb-1), (xCb+cbWidth-1, yCb-1), (xCb-1, yCb-1), (xCb, yCb-1), etc. That is, the positions used to locate blocks 10A0, A1, A2, B0, B1, B2, B3.

[0333] non-adjacent positions on the current picture are positions for which the difference between the horizontal or vertical coordinate and any position within the current block is greater than 1.

[0334] If the top-left corner of the current block is at coordinates (xCb, yCb) relative to the top-left corner of the current picture, the width of the current block is cbWidth, and the height of the current block is cbHeight. Some examples of non-adjacent positions are the positions of the non-adjacent blocks in the current picture as positioned above,

[0335] the coordinates of the block numbered 8 (xCb - cbWidth - 1, yCb - cbHeight - 1),

[0336] the coordinates of the block numbered 11 (xCb - 2*cbWidth - 1, yCb - 2*cbHeight - 1),

[0337] the coordinates of the block numbered 16 (xCb - 3*cbWidth - 1, yCb - 3*cbHeight - 1),

[0338] the coordinates of the block numbered 21 (xCb - 4*cbWidth - 1, yCb - 4*cbHeight - 1),

[0339] the coordinates of the block numbered 9 (xCb + 2*cbWidth - 1, yCb - cbHeight - 1),

[0340] the coordinates of the block numbered 13 (xCb + 3*cbWidth - 1, yCb - 2*cbHeight - 1),

[0341] the coordinates of the block numbered 18 (xCb + 4*cbWidth - 1, yCb - 3*cbHeight - 1),

[0342] the coordinates of the block numbered 23 (xCb + 5*cbWidth - 1, yCb - 4*cbHeight - 1),

[0343] the coordinates of the block numbered 10 (xCb - cbWidth - 1, yCb + 2*cbHeight - 1),

[0344] the coordinates of the block numbered 15 (xCb - 2*cbWidth - 1, yCb + 3*cbHeight - 1),

[0345] the coordinates of the block numbered 20 (xCb - 3*cbWidth - 1, yCb + 4*cbHeight - 1),

[0346] (xCb - 4 * cbWidth - 1, yCb + 5 * cbHeight - 1),

[0347] (xCb + cbWidth / 2, yCb - 2 * cbHeight - 1),

[0348] (xCb + cbWidth / 2, yCb - 3 * cbHeight - 1),

[0349] (xCb + cbWidth / 2, yCb - 4 * cbHeight - 1),

[0350] (xCb - 2 * cbWidth - 1, yCb + cbHeight / 2),

[0351] (xCb - 3 * cbWidth - 1, yCb + cbHeight / 2),

[0352] (xCb - 4 * cbWidth - 1, yCb + cbHeight / 2),

[0353] According to the above example, the non-adjacent positions (coordinates) can be calculated according to (xCb, yCb), cbWidth, cbHeight. Of course, the present scheme does not limit that only the above rule can be used to determine the non-adjacent positions. It also does not limit that only the above numbering order can be checked.

[0354] The information of the positions on the reference image, such as the information of the coordinate (xCb + cbWidth, yCb + cbHeight) in a certain reference image. The reference image can be determined according to a certain preset rule, such as the image with the reference image index of 0 in RPL0, or can be specified by the encoder. Of course, besides the position of T, it can also be the position as shown in Fig. 16. It can be understood that the reference image has been completely decoded, and the information of all the positions on the reference image can be extracted. For example, we can also obtain the information on the reference image according to the coordinates used by the blocks numbered 0-25 in Fig. 15.

[0355] The prediction information of the adjacent positions can be used to determine whether the current block needs to parse the merge_subblock_flag.

[0356] The prediction information of the adjacent positions and the non-adjacent positions on the current image can be used to determine whether the current block needs to parse the merge_subblock_flag.

[0357] The current block can be determined to need to parse the merge_subblock_flag according to the prediction information of the neighboring positions and the non-neighboring positions on the current image and the positions on the reference image.

[0358] The actual selected neighboring positions, the non-neighboring positions on the current image and the positions on the reference image can be different from those shown in the figure, such as specific positions, number, etc.

[0359] The second method of selecting the relevant positions: all the positions selected according to certain rules within a preset range

[0360] A range can be set, and the position of the top-left corner of the current block is set as (xCb, yCb), the width of the current block is set as cbWidth, and the height of the current block is set as cbHeight. The range can be set according to the position of the current block and cbWidth and cbHeight.

[0361] A possible range is all the coded positions within a rectangular region with the top-left corner as (xCb-2*cbWidth, yCb-2*cbHeight), the top-right corner as (xCb+3*cbWidth-1, yCb-2*cbHeight), and the bottom-left corner as (xCb-2*cbWidth, yCb+3*cbHeight-1). The points within the preset range can be searched according to a certain step. If the minimum size of the CU or PU is 4x4, the step can be set as 4, and of course, other values can also be set, such as cbWidth or cbHeight, or a value determined according to cbWidth or cbHeight, such as the smaller one of cbWidth and cbHeight. Here, taking the step as 4 as an example, starting from the coordinate (xCb-2*cbWidth, yCb-2*cbHeight), the positions in the same row can be scanned by adding 4 in the horizontal direction, and the positions in the same column can be scanned by adding 4 in the vertical direction.

[0362] It can be understood that the position of the current block and a fixed width or height can be used to set the range, and a possible range is all the coded positions within a rectangular region with the top-left corner as (xCb-64, yCb-64), the top-right corner as (xCb+64, yCb-64), and the bottom-left corner as (xCb-64, yCb+64).

[0363] It can be understood that the position of the current block and the width and height of the current block and a fixed width or height can be used to set the range, and a possible range is all the coded positions within a rectangular region with the top-left corner as (xCb-64, yCb-64), the top-right corner as (xCb+cbWidth+64, yCb-64), and the bottom-left corner as (xCb-64, yCb+cuHeight+64).

[0364] The judging method

[0365] The prediction information of the relevant position of the check determines the value of the first variable (allowSubblockFlag).

[0366] One possible method is to determine whether a certain or certain specific mode is used for each position that needs to be checked, such as affine mode, which includes affine merge and inter affine mode in VVC. Inter affine mode needs to transmit the MVD (motion vector difference) of the control point in the code stream. The certain or certain specific mode may also include the SBTMVP mode.

[0367] In VVC, affine merge and SBTMVP are both in subblock merge mode, so it can also be determined whether subblock merge mode and inter affine mode are used. For example, it is determined whether the merge_subblock_flag and inter_affine_flag of the position that needs to be checked are at least one of 1. Or it is determined whether the MergeSubblockFlag and InterAffineFlag of the position that needs to be checked are at least one of 1. MergeSubblockFlag of all positions in a block is equal to the value of its merge_subblock_flag; InterAffineFlag of all positions in a block is equal to the value of its inter_affine_flag.

[0368] If at least one of the positions that need to be checked uses a certain or certain specific mode, or its (MergeSubblockFlag||InterAffineFlag)>0, or its MotionModelIdc>0, it is determined that the current block needs to parse merge_subblock_flag.

[0369] Otherwise, that is, none of the positions that need to be checked uses a certain or certain specific mode, or its (MergeSubblockFlag||InterAffineFlag)>0, or its MotionModelIdc>0, it is determined that the current block does not need to parse merge_subblock_flag.

[0370] In a specific implementation, if the positions are checked serially, or the positions are checked in batches, the determination of whether at least one of the positions to be checked uses a certain or certain certain patterns can be used to exit early when the certain or certain certain patterns are determined.

[0371] Another possible method is to determine for each position to be checked whether it uses a certain or certain certain patterns, or its (MergeSubblockFlag || InterAffineFlag) > 0, or its MotionModelldc > 0, and the certain or certain certain patterns are as described above. Count the number of positions that use a certain or certain certain patterns, or its (MergeSubblockFlag || InterAffineFlag) > 0, or its MotionModelldc > 0. If the number reaches or exceeds a threshold, such as 2, then determine that the merge_subblock_flag needs to be parsed. Otherwise, i.e. the number does not reach or exceed the threshold, determine that the current block does not need to parse the merge_subblock_flag.

[0372] Scope of application

[0373] In some embodiments, the first syntax element is denoted as merge_subblock_flag, the first variable is denoted as allowSubblockFlag, and the third variable is denoted as MaxNumSubblockMergeCand. An example of a parsing implementation of a first syntax element is shown in Table 6.

[0374] Table 6

[0375] allowSubblockFlag is a flag that determines whether the current block needs to parse the merge_subblock_flag based on information of some related blocks, and the value of allowSubblockFlag is obtained by the above method.

[0376] The above-mentioned size adjustment conditions and the method of determining whether the current block needs to parse the merge_subblock_flag based on information of some related blocks can be used alone or in combination.

[0377] An example of a control syntax is shown in Table 7:

[0378] Table 7

[0379] The method of adjusting the limit of block size is used to expand the limit of block size to cbWidth*cbHeight>=32, and for the newly expanded blocks, it is determined whether the flag of merge_subblock_flag needs to be parsed according to the information of some related blocks.

[0380] An example of the control syntax is shown in Table 8:

[0381] Table 8

[0382] The process of determining the context of the first syntax element according to the prediction information of some related blocks or related positions is further illustrated below.

[0383] It is mentioned above that whether the flag of merge_subblock_flag needs to be parsed is determined according to the information of some related blocks or related positions. The context model of the flag of merge_subblock_flag of the current block can also be determined according to the information of some related blocks or related positions. It should be noted that the method of determining the context model of the flag of merge_subblock_flag can be used in combination with the method of determining whether the flag of merge_subblock_flag needs to be parsed, or only one of the methods can be used.

[0384] In modern coding standards, such as VVC, CABAC (context-based adaptive binary arithmetic coding) arithmetic coding based on context model is usually used to improve compression efficiency. For syntax elements like merge_subblock_flag, all its possible values are 0 and 1, which can be represented by a binary symbol. The context model is to estimate the probability of the flag of merge_subblock_flag of the current block being 0 or 1 using the context information. The more accurate the probability estimation is, the higher the compression efficiency is.

[0385] In VVC, there are three context models for merge_subblock_flag. One possible method is to determine the context model of the flag of merge_subblock_flag of the current block according to the information of the blocks adjacent to the left and top of the current block. The indexes of the three context models are 0, 1, and 2 respectively. If the coordinates of the top-left corner of the current block relative to the top-left corner of the current picture are (xCb, yCb), the block adjacent to the left of the current block is the block including the coordinates (xCb-1, yCb), and the block adjacent to the top of the current block is the block including the coordinates (xCb, yCb-1). It is determined whether these blocks use some specific modes, such as subblock merge mode and inter affine mode.

[0386] If none of the two blocks use a mode, the context model with index 0 is selected.

[0387] If only one of the two blocks use a mode, the context model with index 1 is selected.

[0388] If both of the two blocks use a mode, the context model with index 2 is selected.

[0389] Another possible method can use the neighboring blocks (or positions), the non- neighboring blocks (or positions) in the current picture, and the blocks (or positions) on the reference picture to determine the context model of the merge_subblock_flag of the current block. The context model of the merge_subblock_flag of the current block can be determined by counting the cases that the neighboring blocks (or positions), the non- neighboring blocks (or positions) in the current picture, and the blocks or positions on the reference picture use certain specific modes or their certain variables such as the values of MergeSubblockFlag, InterAffineFlag, MotionModelIdc. It can be understood that only the neighboring blocks or positions can be used, or only the neighboring blocks (or positions) and the non- neighboring blocks (or positions) in the current picture can be used.

[0390] A second variable cnt is recorded.

[0391] All the blocks (or positions) that need to be checked are examined, and for each of the blocks (or positions) that need to be checked, if it uses a certain or certain specific mode, or its (MergeSubblockFlag || InterAffineFlag) > 0, or its MotionModelIdc > 0, cnt = cnt + 1.

[0392] The context model is determined according to the value of cnt, such as

[0393] If 0 <= cnt <= THR1, the context model with index 0 is selected.

[0394] Otherwise if THR1 < cnt <= THR2, the context model with index 1 is selected.

[0395] Otherwise, THR2 < cnt, the context model with index 2 is selected.

[0396] An example is that THR1 is equal to 2 and THR2 is equal to 6.

[0397] If neighboring blocks (or positions) and non-neighboring blocks (or positions) in the current picture are used, different weights can be set for different blocks (or positions), such as if it is a neighboring block (or position) and it uses a certain or certain modes, or its (MergeSubblockFlag || InterAffineFlag) > 0, or its MotionModelIdc > 0, cnt = cnt + 2. If it is a non-neighboring block (or position) in the current picture and it uses a certain or certain modes, or its (MergeSubblockFlag || InterAffineFlag) > 0, or its MotionModelIdc > 0, cnt = cnt + 1.

[0398] The embodiments of the present application mainly improve in the following three aspects: the first aspect is to set the limit condition of the block size, the second aspect is to determine whether the first syntax element needs to be parsed according to the prediction information of some related blocks or positions, and the third aspect is to determine the context model of the first syntax element of the current block according to the prediction information of some related blocks or positions. Therefore, more blocks can use the sub-block merge mode, and the affine model coded in the front can be more easily transmitted to the block coded in the back. In addition, unnecessary transmission of the first syntax element is reduced, unnecessary coding attempts of the encoder are reduced, and the decoding efficiency of the decoder is improved.

[0399] In another embodiment of the present application, referring to FIG. 18, a flowchart of an encoding method provided by the embodiment of the present application is shown. As shown in FIG. 18, the method can include:

[0400] S201: In the case where it is determined that the sub-block merge mode is allowed to be used for the current block, constructing a sub-block merge candidate list of the current block;

[0401] In some embodiments, the sub-block merge mode is allowed to be used for the current block in the case where the coding condition of the first syntax element of the current block is met. The encoder determines whether to code the first syntax element by judging whether the coding condition is met when coding the current block. For the encoder, the coding condition of the first syntax element can also be understood as a use condition of the sub-block merge mode.

[0402] In some embodiments, the method can further include: determining the width and height of the current block; and determining that the sub-block merge mode is allowed to be used for the current block in the case where the width of the current block is greater than or equal to a first threshold value and the height of the current block is greater than or equal to a second threshold value; wherein the first threshold value and the second threshold value are equal or not equal.

[0403] That is, the coding condition of the first syntax element of the current block includes a first size restriction condition, and the first syntax element needs to be parsed only when the size of the current block satisfies the first size restriction condition; when the size of the current block does not satisfy the first size restriction condition, the first syntax element does not need to be parsed, or the judgment is based on other conditions in the coding condition.

[0404] In some embodiments, the first threshold value and the second threshold value are equal. For example, the first threshold value and the second threshold value can be 8, that is, the first size restriction condition of the current block includes cbWidth >= 8 && cbHeight >= 8, cbWidth represents the width of the current block, and cbHeight represents the height of the current block. The first threshold value and the second threshold value can also be 4, 16, etc.

[0405] In some embodiments, the first threshold value and the second threshold value are not equal. For example, the first threshold value can be 4 and the second threshold value can be 8, that is, the first size restriction condition of the current block includes cbWidth >= 4 && cbHeight >= 8. The first threshold value can be 8 and the second threshold value can be 4, that is, the first size restriction condition of the current block includes cbWidth >= 8 && cbHeight >= 4.

[0406] It should be noted that the first threshold value and the second threshold value can be fixed values, and the first threshold value and the second threshold value can also be configured according to actual needs, and the first threshold value and the second threshold value can also be adaptively selected according to actual needs.

[0407] In some embodiments, the method can further include: determining the width and height of the current block; and determining that the current block is allowed to use the sub-block merge mode when the product of the width and the height of the current block is greater than or equal to a third threshold value. The third threshold value is used to limit the lower limit value of the product of the width and the height of the current block (which can also be understood as the number of pixels of the current block), and by limiting the product of the width and the height of the current block, more blocks can use the sub-block merge mode, thereby expanding the application range of the sub-block merge mode.

[0408] That is, the coding condition of the first syntax element of the current block includes a second size restriction condition, and the first syntax element needs to be parsed only when the size of the current block satisfies the second size restriction condition; when the size of the current block does not satisfy the second size restriction condition, the first syntax element does not need to be parsed, or the judgment is based on other conditions in the coding condition.

[0409] In some embodiments, the third threshold value can be 64, i.e., the second size limit condition of the current block includes cbWidth*cbHeight>=64. Taking FIG. 12 as an example, if the size of the middle block is 4*16, the second size limit of the sub-block merge mode is met, the affine merge can be used. For the right block coded subsequently, the affine merge can be used, and the affine model can be inherited from the middle block, so that more blocks similar to the middle block can use the sub-block merge mode.

[0410] In some embodiments, the third threshold value can be 32. That is, the second size limit condition of the current block includes cbWidth*cbHeight>=32. The sub-block merge mode is extended to blocks with smaller width-height products, so that more blocks can use the sub-block merge mode.

[0411] It should be noted that the third threshold value can also be a value less than 32, for example, the third threshold value is 16. The third threshold value can also be a value greater than 64, for example, the third threshold value can be 128 or 256. The third threshold value can also be a value greater than 32 and less than 64, for example, the third threshold value can be 48.

[0412] It should also be noted that the third threshold value can be a fixed value, and the third threshold value can also be configured according to actual needs, and the third threshold value can also be adaptively selected according to actual needs.

[0413] In some embodiments, the coding condition of the first syntax element of the current block includes the first size limit condition and the second size limit condition. On the basis that the size of the current block meets the first size limit condition and the second size limit condition, the first syntax element needs to be parsed; otherwise, the first syntax element does not need to be parsed, or it is determined based on other conditions in the coding condition.

[0414] That is, the application scenario of the sub-block merge mode can be expanded by setting two size limit conditions. For example, the size limit condition of the current block includes cbWidth>=4&&cbHeight>=8&&(cbWidth*cbHeight)>=32.

[0415] In some embodiments, the method can further include: determining that the current block allows the use of the sub-block merge mode in a case where the value of the third variable of the current block indicates that the maximum number of candidates of the sub-block merge candidate list is greater than 0.

[0416] That is, the coding condition of the first syntax element of the current block further includes that the maximum number of candidates of the sub-block merge candidate list is greater than 0.

[0417] The value of the third variable can be controlled by some high-level syntax, such as the syntax of a sequence parameter set, to control the maximum number of candidates of the subblock merge mode for a current sequence, and the whole sequence is executed according to the condition. The maximum number of candidates greater than 0 indicates that there is at least one candidate of the subblock merge mode for the current sequence, and the maximum number of candidates equal to 0 or less than 0 indicates that the subblock merge mode is not used for the current sequence, and there is no need to parse the first syntax element. The maximum number of candidates greater than 0 can be used as a prerequisite condition for parsing the first syntax element, combined with any one of the encoding conditions in the embodiments of the present application.

[0418] In some embodiments, the method can further include: obtaining coded prediction information used for one or more positions related to the current block; determining the value of the first variable of the current block based on the prediction information used for the one or more positions related to the current block; and determining whether the subblock merge mode is allowed to be used for the current block based on the value of the first variable of the current block.

[0419] The value of the first variable is used to indicate whether the first syntax element is allowed to be parsed for the current block, and can also be used to indicate whether the subblock merge mode is allowed to be used for the current block, and the value of the first variable is determined according to the prediction information used for the positions related to the current block.

[0420] The encoding condition of the first syntax element of the current block includes that the value of the first variable indicates that the first syntax element is allowed to be parsed. The value of the first variable is derived from the coded prediction information used for one or more positions related to the current block, and in addition, the value of the first variable can be controlled by some high-level syntax, such as the syntax of a sequence parameter set, to control whether the first syntax element is allowed to be parsed for a current sequence.

[0421] The one or more positions related to the current block can be understood as positions having relevance to the current block in a coded image region, and can also be referred to as relevant positions. The prediction information of the relevant positions can be used as a reference for the current block to determine whether the first syntax element needs to be parsed.

[0422] In some embodiments, the relevant positions include adjacent positions of the current block in a current image, and the relevant positions can also include non-adjacent positions of the current block in the current image, and the relevant positions can also include one or more relevant positions of a collocated block of the current block in a reference image.

[0423] In some embodiments, the one or more positions related to the current block include at least one of the following: one or more preset adjacent positions of the current block in a current image, one or more preset non-adjacent positions of the current block in the current image, and one or more preset relevant positions of the current block in a reference image.

[0424] In some embodiments, the one or more relevant positions relative to the current block include at least one of: a relevant position of the current block in a first range of the current picture determined based on a first search rule, and one or more relevant positions of the current block in a second range of the reference picture determined based on a second search rule.

[0425] For example, the first range can be the entire or part of the coded region of the current picture, and the second range can be the entire or part of the coded region of the reference picture. In some embodiments, the first range can include an upper region, an upper-left region, a left region and a lower-left region of the current block in the current picture. The second range can include a lower-right region of the collocated block in the reference picture.

[0426] In some embodiments, the first search rule can be to search the first range based on a specific search step, and the second search rule can be to search the second range based on the specific search step.

[0427] In some embodiments, the first search rule can also be to search a preset position in the first range, and the second search rule can also be to search a preset position in the second range.

[0428] In some embodiments, based on the relevant position, a relevant block in which the relevant position is located is determined, and prediction information of the relevant block is obtained as the prediction information used by the relevant position. That is, when the prediction information of the coded block is stored in units of blocks, the relevant position is used to locate the relevant block, so as to obtain the prediction information of the relevant block.

[0429] In some embodiments, based on the relevant position, the prediction information used by the relevant position is obtained. That is, when the prediction information of the coded pixel is stored in units of pixels, the prediction information of the relevant position is directly obtained.

[0430] In some embodiments, based on the prediction information used by the one or more relevant positions relative to the current block, a value of a first variable of the current block is determined, including: in a case where the prediction information used by the one or more relevant positions relative to the current block satisfies a first condition, determining that the value of the first variable is a first value; and in a case where the prediction information used by the one or more relevant positions relative to the current block does not satisfy the first condition, determining that the value of the first variable is a second value.

[0431] In some embodiments, when the value of the first variable of the current block is the first value, it is determined that the current block is allowed to use a sub-block merge mode; and when the value of the first variable of the current block is the second value, it is determined that the current block is not allowed to use the sub-block merge mode. The first value and the second value are not equal. For example, the first value can be 1, and the second value can be 0.

[0432] The first condition is used as a judgment condition for whether to allow parsing the first syntax element.

[0433] In some embodiments, the prediction information includes a prediction mode identifier, and the first condition includes determining, based on the prediction mode identifier, that a prediction mode used by the at least one related position is a first prediction mode. The prediction mode identifier is used to indicate a prediction mode of the related position or the related block, and when the prediction mode of the at least one related position or the related block is the first prediction mode, a value of the first variable is determined to be a first numerical value; otherwise, the value of the first variable is determined to be a second numerical value. By checking the related block or the related position, it is determined whether it uses a certain or certain specific mode, and then it is determined whether to parse the first syntax element of the current block.

[0434] For example, the at least one related position can be determined by checking all related positions of the current block, or determined by checking the related positions of the current block based on the first order. The first condition can also include that the number of related positions whose prediction mode is the first prediction mode is greater than a first number threshold, and the first number threshold can be 0, or the first number threshold can be an integer greater than 0.

[0435] In some embodiments, the first prediction mode includes at least one of the following: a subblock merge mode, an affine merge mode, an inter affine mode, and a subblock-based temporal motion vector prediction (SBTMVP) mode.

[0436] The subblock merge mode can include any one or more subblock-based merge modes. In some embodiments, the affine merge mode and the SBTMVP mode are both subblock-based merge modes, and in VVC, the affine merge mode and the SBTMVP mode are both placed in the subblock merge mode, i.e., the affine merge mode and the SBTMVP mode use merge_subblock_flag at the same time. In some embodiments, the affine merge mode and the SBTMVP mode can also be used separately.

[0437] The inter affine mode is controlled by inter affine flag, and the inter affine mode needs to transmit a motion vector difference (MVD) of a control point in a code stream.

[0438] The coding condition includes that at least one of the blocks or positions to be checked uses a certain or certain specific mode, and it is determined that the first syntax element of the current block needs to be parsed. For example, (MergeSubblockFlag || InterAffineFlag) > 0, which uses a subblock merge mode or an inter affine mode, otherwise, it is not used.

[0439] In some embodiments, the prediction information includes a motion model identifier; the first condition can include determining, based on the motion model identifier, that a motion model used by at least one of the related positions is an affine model. For example, the first condition can also include that the number of related positions using a motion model that is a radial model is greater than a first number threshold, which can be 0, or an integer greater than 0.

[0440] In some embodiments, the affine model includes at least one of: a 4-parameter based affine model and a 6-parameter based affine model.

[0441] In some embodiments, the prediction information includes a prediction mode identifier and a motion model identifier; the first condition can include determining, based on the prediction mode identifier, that a prediction mode used by at least one of the related positions is a first prediction mode, or determining, based on the motion model identifier, that a motion model used by at least one of the related positions is an affine model.

[0442] The coding condition of the first syntax element of the current block includes that at least one of the blocks or positions to be checked uses a certain or certain specific mode, or that the motion model of at least one of the blocks or positions to be checked is an affine model, and it is determined that the first syntax element of the current block needs to be parsed. That is, the prediction mode identifier and the motion model identifier can be checked at the same time, and as long as one of them is satisfied, it is determined that the first syntax element of the current block needs to be parsed; otherwise, it is determined that the first syntax element of the current block does not need to be parsed.

[0443] In some embodiments, the method can further include: determining the width and height of the current block; and determining that the current block is allowed to use the subblock merge mode when at least one of the following conditions is met: the width of the current block is less than a fourth threshold, the height of the current block is less than a fifth threshold, and the product of the width and the height of the current block is less than a sixth threshold.

[0444] That is, the coding condition of the first syntax element of the current block includes a third size limit condition, and only when the size of the current block meets the third size limit condition, the first syntax element needs to be parsed; when the size of the current block does not meet the third size limit condition, the first syntax element does not need to be parsed, or it is determined based on other conditions in the coding condition.

[0445] In some embodiments, the fourth threshold and the fifth threshold are equal. For example, the fourth threshold and the fifth threshold can be 8, i.e., the third size limitation condition of the current block can include cbWidth < 8 || cbHeight < 8, or the third size limitation condition of the current block can include cbWidth < 8 && cbHeight < 8. The fourth threshold and the fifth threshold can also be 4, 16, etc. The encoding method provided by the embodiments of the present application can be applied to all blocks, or can be applied only to blocks of certain size range.

[0446] In some embodiments, the fourth threshold and the fifth threshold are not equal. For example, the fourth threshold can be 4 and the fifth threshold can be 8, i.e., the third size limitation condition of the current block includes cbWidth < 4 && cbHeight < 8.

[0447] The sixth threshold is used to limit the upper limit value of the product of the width and height of the current block (which can also be understood as the number of pixels of the current block), so that more blocks can use the sub-block merge mode, thereby expanding the application range of the sub-block merge mode.

[0448] In some embodiments, the sixth threshold can be 64, and the sixth threshold can be 32.

[0449] In some embodiments, the encoding condition of the first syntax element of the current block includes that the width of the current block is less than the fourth threshold or the height of the current block is less than the fifth threshold, and the value of the first variable of the current block indicates that the first syntax element is allowed to be parsed. For example, a possible encoding condition can include (cbWidth < 8 || cbHeight < 8) && allowSubblockFlag.

[0450] In some embodiments, the product of the width and height of the current block is less than the sixth threshold, and the value of the first variable of the current block indicates that the first syntax element is allowed to be parsed. For example, a possible encoding condition can include cbWidth * cbHeight < 64 && allowSubblockFlag.

[0451] The sub-block merge candidate list includes one or more candidates. For affine, the current block first checks whether the neighboring blocks at several specific positions around the current block use affine mode. If a neighboring block uses affine mode, the affine model or affine parameters of the neighboring block can be directly inherited and applied to the current block as a candidate. If there are more blocks around the current block that use affine mode, the current block has more candidates to choose from, and vice versa.

[0452] In the sub-block merge candidate list of VVC, the SBTMVP mode has only one candidate, and it is placed in the first position of the sub-block merge list, followed by the candidate of affine merge. If the current block uses the sub-block merge mode, i.e., merge_subblock_flag[x0][y0] is 1, the encoder will build a sub-block merge candidate list, select the corresponding candidate according to merge_subblock_idx[x0][y0] to determine the motion information of each sub-block of the current block, and make a prediction value according to the motion information.

[0453] S202: determining the motion information of the sub-blocks of the current block based on the sub-block merge candidate list of the current block;

[0454] In some embodiments, the method further comprises: in the case that the value of the first syntax element indicates that the current block uses the sub-block merge mode, and the value of the third variable of the current block indicates that the maximum number of candidates of the sub-block merge candidate list is greater than 1, determining that the current block is allowed to use the sub-block merge mode.

[0455] Correspondingly, the determination of the motion information of the sub-blocks of the current block based on the sub-block merge candidate list of the current block comprises: determining the motion information of the sub-blocks of the current block based on the index value of the sub-block merge candidate list of the current block and the sub-block merge candidate list.

[0456] That is, in the case that the value of the first syntax element indicates that the sub-block merge mode is used, and the maximum number of candidates indicated by the third variable is greater than 1, the encoder needs to determine the index value of the sub-block merge candidate list and encode it. Exemplarily, the index value of the sub-block merge candidate list is indicated by the syntax element merge_subblock_idx. The merge_subblock_idx can directly represent the index value, or indirectly represent the index reference value to save the encoding bits. For example, the merge_subblock_idx represents the index value minus 1.

[0457] S203: determining the prediction value of the sub-blocks of the current block based on the motion information of the sub-blocks of the current block.

[0458] S204: determining the value of the first syntax element of the current block based on the encoding decision of the sub-block merge mode for the sub-blocks of the current block, the first syntax element being used to indicate whether the current block uses the sub-block merge mode;

[0459] In some embodiments, different prediction mode values can be obtained by iteratively traversing different prediction modes, a prediction cost is calculated according to the prediction values, and it is determined whether the optimal prediction mode is the sub-block merge mode. If the optimal prediction mode is the sub-block merge mode, the first syntax element has a first value, otherwise, the first syntax element has a second value. Exemplary prediction costs include, but are not limited to, sum of absolute difference (SAD), sum of absolute transformed difference (SATD), sum of squared difference (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), rate-distortion cost (RDO), and the like.

[0460] S205: encode the first syntax element of the current block, and write the obtained coded bits into the bitstream.

[0461] In some embodiments, residual values of the sub-blocks of the current block are determined based on the prediction values and original values of the sub-blocks of the current block; and the residual values are encoded, and the obtained coded bits are written into the bitstream.

[0462] In some embodiments, the method can further include: obtaining prediction information used for one or more positions related to the current block; determining a context index value of the first syntax element of the current block based on the prediction information used for the one or more positions related to the current block; determining a context of the first syntax element based on the context index value; and encoding the first syntax element of the current block based on the context of the first syntax element.

[0463] The context index value is used to index the context (also referred to as context model or context probability model) of the first syntax element. The context of the first syntax element is used to represent the probability of the value of the first syntax element being 0 or 1. Specifically, the bitstream is entropy encoded based on the context of the first syntax element to determine the value of the first syntax element.

[0464] Modern coding standards, such as VVC, usually use CABAC (context-based adaptive binary arithmetic coding) arithmetic coding based on context model to improve compression efficiency. For syntax elements like merge_subblock_flag, all its possible values are just 0 and 1, which can be represented by a binary symbol. The context model is used to estimate the probability of the current block's merge_subblock_flag being 0 or 1 using context information. The more accurate the probability estimation, the higher the compression efficiency.

[0465] The one or more positions related to the current block can be understood as positions within the coded image region having a correlation with the current block, and can also be referred to as related positions. The prediction information of the related positions can be used as a reference for the current block to determine whether the first syntax element needs to be parsed.

[0466] In some embodiments, the related positions include neighboring positions of the current block within the current image. The related positions can also include non-neighboring positions of the current block within the current image. The related positions can also include one or more related positions of the collocated block of the current block within the reference image.

[0467] In some embodiments, the related positions include neighboring positions of the current block within the current image. The related positions can also include non-neighboring positions of the current block within the current image. The related positions can also include one or more related positions of the collocated block of the current block within the reference image.

[0468] In some embodiments, the one or more positions related to the current block include at least one of the following: one or more preset neighboring positions of the current block within the current image, one or more preset non-neighboring positions of the current block within the current image, and one or more preset related positions of the current block within the reference image.

[0469] In some embodiments, the one or more positions related to the current block include at least one of the following: a related position of the current block within a first range of the current image determined based on a first search rule, and one or more related positions of the current block within a second range of the reference image determined based on a second search rule.

[0470] For example, the first range can be the entire coded region or a part of the coded region of the current image, and the second range can be the entire coded region or a part of the coded region of the reference image. In some embodiments, the first range can include an upper region, an upper-left region, a left region, and a lower-left region of the current block within the current image. The second range can include a lower-right region of the collocated block within the reference image.

[0471] In some embodiments, the first search rule can be to search the first range based on a specific search step, and the second search rule can be to search the second range based on a specific search step.

[0472] In some embodiments, the first search rule can also be to search a preset position within the first range, and the second search rule can also be to search a preset position within the second range.

[0473] In some embodiments, based on the related position, a related block in which the related position is located is determined; and prediction information of the related block is obtained as the prediction information used by the related position. That is, when the prediction information of the coded block is stored in a block unit, the related position is used to locate the related block, so as to obtain the prediction information of the related block.

[0474] In some embodiments, based on the related position, the prediction information used by the related position is obtained. That is, when the prediction information of the coded pixel is stored in a pixel unit, the prediction information of the related position is directly obtained.

[0475] It should be noted that the related position used to determine the value of the first variable of the current block can be the same as or at least partially different from the related position used to determine the context index value of the first syntax element of the current block.

[0476] In some embodiments, in a case where the prediction information used by the related position satisfies a second condition, the related value of the related position is determined as a third numerical value; in a case where the prediction information used by the related position does not satisfy the second condition, the related value of the related position is determined as a fourth numerical value; based on one or more related values of the related position of the current block, a value of a second variable of the current block is determined; and based on the value of the second variable of the current block, a context index value of the first syntax element of the current block is determined.

[0477] In some embodiments, the third numerical value can be 1, and the fourth numerical value can be 0.

[0478] In some embodiments, the prediction information includes a prediction mode identifier; and the second condition includes that the prediction mode identifier of the related position indicates that the prediction mode of the related position is a first prediction mode.

[0479] In some embodiments, the prediction information includes a motion model identifier; and the second condition includes that the motion model identifier of the related position indicates that the motion model of the related position is an affine model.

[0480] In some embodiments, the prediction information includes a prediction mode identifier and a motion model identifier; and the second condition includes that the prediction mode identifier of the related position indicates that the prediction mode of the related position is a first prediction mode, or the motion model identifier of the related position indicates that the motion model of the related position is an affine model.

[0481] In some embodiments, determining the value of the second variable of the current block based on the correlation values of the one or more relevant positions relative to the current block comprises: determining the value of the second variable of the current block based on the correlation values of the one or more relevant positions relative to the current block and a weight value. The weight value is related to the relevance of the relevant positions to the current block, for example, the weight value is related to the distance between the relevant positions and the current block, the smaller the distance, the larger the weight value, and vice versa. The accuracy of the value of the second variable can be improved by the weighted operation.

[0482] In some embodiments, the value of the second variable of the current block is used as the context index value of the first syntax element of the current block. The value of the second variable of the current block is mapped to the context index value based on a preset mapping relationship. The mapping relationship can be a preset function relationship or a preset corresponding relationship.

[0483] In some embodiments, in VVC, merge_subblock_flag has 3 context models, and the one or more relevant positions relative to the current block include the left neighboring block and the top neighboring block of the current block. If neither of the two blocks uses the first prediction mode, the value of the second variable is 0, and the context model with index 0 is selected. If only one of the two blocks uses the first prediction mode, the value of the second variable is 1, and the context model with index 1 is selected. If both of the two blocks use the first prediction mode, the value of the second variable is 2, and the context model with index 2 is selected.

[0484] In some embodiments, determining the context index value of the first syntax element of the current block according to the value of the second variable of the current block comprises: when the value of the second variable is less than or equal to a seventh threshold value, determining the context index value as a first index value; when the value of the second variable is greater than the seventh threshold value and less than or equal to an eighth threshold value, determining the context index value as a second index value; and when the value of the second variable is greater than the eighth threshold value, determining the context index value as a third index value. That is, the value of the second variable can be mapped to the context index value based on the corresponding relationship defined by the seventh threshold value and the eighth threshold value, and the corresponding context model is further determined.

[0485] By using the above technical solutions, the coding conditions of the first syntax element are optimized, unnecessary transmission of the first syntax element is reduced, the code stream overhead is effectively controlled, unnecessary coding attempts are reduced, and more blocks can use the sub-block merge mode, so that the affine model of the coded block is more easily transmitted to subsequent blocks, the sub-block merge candidate list is optimized, and the coding efficiency is improved.

[0486] Further, based on the prediction information of the one or more relevant positions relative to the current block, it is determined whether the first syntax element of the current block needs to be parsed, unnecessary transmission of the first syntax element is reduced, unnecessary coding attempts are reduced, and the coding efficiency is improved.

[0487] Further, by adjusting the limitation condition of the block size, more blocks can use the sub-block merge mode, specifically, the strip block, small size block, etc. can also use the sub-block merge mode, so that the affine model of the coded block is more easily transmitted to the subsequent block, and the sub-block merge candidate list is optimized.

[0488] In another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, referring to FIG. 19, a schematic diagram of the composition structure of an encoder provided in the embodiment of the present application is shown. As shown in FIG. 19, the encoder 190 can include a first prediction unit 1901, a first determination unit 1902 and an encoding unit 1903; wherein,

[0489] The first prediction unit 1901 is configured to, in the case of determining that the sub-block merge mode is allowed to be used for the current block, construct a sub-block merge candidate list of the current block; determine the motion information of the sub-block of the current block based on the sub-block merge candidate list of the current block; and determine the prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block.

[0490] The first determination unit 1902 is configured to make an encoding decision on the sub-block merge mode based on the prediction value of the sub-block of the current block, and determine the value of the first syntax element of the current block, the first syntax element being used to indicate whether the sub-block merge mode is used for the current block.

[0491] The encoding unit 1903 is configured to perform encoding processing on the first syntax element of the current block, and write the obtained encoding bits into a bitstream.

[0492] It can be understood that the various functional units of the encoder also perform the encoding method of any one of the foregoing embodiments.

[0493] It can be understood that in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the various components in the embodiments can be integrated in a processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0494] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium based on such understanding. The technical solutions of the embodiments essentially or the part of the prior art that contributes or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the embodiments. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0495] Based on the components of the encoder 190 and the computer readable storage medium, referring to FIG. 20, a specific hardware structure diagram of the encoder 190 provided by the embodiments of the present application is shown. As shown in FIG. 20, the encoder 190 can include a first communication interface 2001, a first memory 2002 and a first processor 2003; each component is coupled together through a first bus system 2004. It can be understood that the first bus system 2004 is used to realize the connection communication between the components. The first bus system 2004 includes a data bus, a power bus, a control bus and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the first bus system 2004 in FIG. 20. Among them,

[0496] The first communication interface 2001 is used for receiving and sending signals in the process of transceiving information with other external network elements;

[0497] The first memory 2002 is used for storing computer programs capable of running on the first processor 2003;

[0498] The first processor 2003 is used for executing the following when running the computer programs:

[0499] In the case of determining that the current block is allowed to use the sub-block merge mode, constructing a sub-block merge candidate list of the current block;

[0500] Based on the sub-block merge candidate list of the current block, determining the motion information of the sub-block of the current block;

[0501] Based on the motion information of the sub-block of the current block, determining the prediction value of the sub-block of the current block;

[0502] The coding decision of the subblock merge mode is made based on a prediction value of a subblock of the current block, and a value of a first syntax element of the current block is determined, the first syntax element being used to indicate whether the current block uses the subblock merge mode or not.

[0503] The first syntax element of the current block is encoded, and the obtained coding bits are written into the bitstream.

[0504] It can be understood that the first memory 2002 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The first memory 2002 of the system and method described herein are intended to include, without being limited to, these and any other suitable types of memory.

[0505] The first processor 2003 can be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the first processor 2003 or the instruction in the form of software. The first processor 2003 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register, and other mature storage media in the art. The storage medium is located in the first memory 2002, and the first processor 2003 reads the information in the first memory 2002 and combines the hardware to complete the steps of the above method.

[0506] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be realized in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing functions of the present application or a combination thereof. For software implementation, the techniques of the present application can be realized by modules (such as processes, functions, etc.) for executing functions of the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0507] Optionally, as another embodiment, the first processor 2003 is further configured to execute the method of any one of the preceding embodiments when running the computer program.

[0508] The embodiment provides an encoder, in which the coding condition of the first syntax element is optimized, unnecessary first syntax element transmission is reduced, code stream overhead is effectively controlled, unnecessary coding attempts of the encoder can also be reduced, more blocks can use the sub-block merge mode, so that the motion model of the coded block is more easily passed to a subsequent block, the sub-block merge candidate list is optimized, and coding efficiency is improved.

[0509] The embodiment of the application further provides a code stream, wherein the code stream is generated by bit coding according to to-be-coded information; and the to-be-coded information comprises at least one of the following: the first syntax element and an index value of the sub-block merge candidate list; and the first syntax element is used for indicating whether the current block uses the sub-block merge mode.

[0510] The embodiment of the application further provides a computer readable storage medium, which stores the code stream generated by the coding method.

[0511] The embodiment of the application further provides a computer readable storage medium, which is applied to the encoder 190, and stores a computer program; and the computer program is executed by the first processor to implement the method of any one of the preceding embodiments.

[0512] In still another embodiment of the application, based on the same inventive concept of the preceding embodiments, referring to FIG. 21, a constituent structure schematic diagram of a decoder 210 provided by the embodiment of the application is shown. As shown in FIG. 21, the decoder 210 can comprise a decoding unit 2101 and a second prediction unit 2102; wherein,

[0513] The decoding unit 2101 is configured to parse the code stream, and determine the value of the first syntax element of the current block, wherein the first syntax element is used for indicating whether the current block uses the sub-block merge mode.

[0514] The second prediction unit 2102 is configured to, in the case that the value of the first syntax element indicates that the current block uses the sub-block merge mode, construct the sub-block merge candidate list of the current block; determine the motion information of the sub-block of the current block based on the sub-block merge candidate list of the current block; and determine the prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block.

[0515] It can be understood that the various functional units of the decoder also execute the decoding method of any one of the preceding embodiments.

[0516] Based on the components of the decoder 210 and the computer readable storage medium, referring to FIG. 22, a specific hardware structure diagram of the decoder 210 is shown. As shown in FIG. 22, the decoder 210 can include a second communication interface 2201, a second memory 2202 and a second processor 2203; and the components are coupled together through a second bus system 2204. It can be understood that the second bus system 2204 is used to realize the connection communication between the components. The second bus system 2204 includes not only a data bus, but also a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the second bus system 2204 in FIG. 22. Among them,

[0517] The second communication interface 2201 is configured to receive and send signals in the process of transceiving information with other external network elements.

[0518] The second memory 2202 is configured to store a computer program capable of running on the second processor 2203.

[0519] The second processor 2203 is configured to execute the following when running the computer program:

[0520] Parsing the code stream to determine the value of the first syntax element of the current block, the first syntax element being used to indicate whether the current block uses the sub-block merge mode;

[0521] In the case where the value of the first syntax element indicates that the current block uses the sub-block merge mode, constructing a sub-block merge candidate list of the current block;

[0522] Determining the motion information of the sub-block of the current block based on the sub-block merge candidate list of the current block;

[0523] Determining the prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block.

[0524] Optionally, as another embodiment, the second processor 2203 is further configured to execute the method of any one of the preceding embodiments when running the computer program.

[0525] It can be understood that the hardware function of the second memory 2202 is similar to that of the first memory 2002, and the hardware function of the second processor 2203 is similar to that of the first processor 2003; and details are not described here.

[0526] The embodiment provides a decoder, in which the parsing condition of the first syntax element is optimized, unnecessary transmission of the first syntax element is reduced, the code stream overhead is effectively controlled, and more blocks can use the sub-block merge mode, so that the motion model of the decoded block is more easily passed to the subsequent block, the sub-block merge candidate list is optimized, and the decoding efficiency is improved.

[0527] The embodiment of the present application provides a computer readable storage medium applied to the encoder 210, the computer readable storage medium stores a computer program, and the computer program is executed by a second processor to realize the method in any one of the foregoing embodiments.

[0528] In still another embodiment of the present application, referring to FIG. 23, a schematic structural diagram of a codec system is shown. As shown in FIG. 23, the codec system 230 can include an encoder 2301 and a decoder 2302.

[0529] In the embodiment of the present application, the encoder 2301 can be the encoder in any one of the foregoing embodiments, and the decoder 2302 can be the decoder in any one of the foregoing embodiments.

[0530] It should be noted that in the present application, the terms "comprising", "containing" or any other variants thereof are intended to cover non-exclusive containing, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0531] The serial numbers of the foregoing embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0532] The methods disclosed in the several method embodiments of the present application can be combined arbitrarily to obtain new method embodiments, without conflict. The features disclosed in the several product embodiments of the present application can be combined arbitrarily to obtain new product embodiments, without conflict. The features disclosed in the several method or device embodiments of the present application can be combined arbitrarily to obtain new method or device embodiments, without conflict.

[0533] The above is merely specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims. Industrial applicability

[0534] Provided in the embodiments of the present application are a coding and decoding method, a code stream, an encoder, a decoder and a storage medium. Taking a decoding end as an example, the method comprises the following steps: parsing a code stream, determining a value of a first syntax element of a current block; in the case that the value of the first syntax element indicates that the current block uses a sub-block merge mode, constructing a sub-block merge candidate list of the current block; determining motion information of a sub-block of the current block based on the sub-block merge candidate list of the current block; and determining a prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block. In this way, the parsing condition of the first syntax element is optimized, unnecessary transmission of the first syntax element is reduced, the code stream overhead is effectively controlled, and more blocks can use the sub-block merge mode, so that the motion model of the decoded block is more easily passed to a subsequent block, the sub-block merge candidate list is optimized, and the decoding efficiency is improved.

Claims

1. A decoding method applied to a decoder, the method comprising: parsing a bitstream to determine a value of a first syntax element of a current block, the first syntax element being used to indicate whether the current block uses a sub-block merge mode; in a case where the value of the first syntax element indicates that the current block uses the sub-block merge mode, constructing a sub-block merge candidate list of the current block; determining motion information of a sub-block of the current block based on the sub-block merge candidate list of the current block; determining a prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block.

2. The method of claim 1, wherein, The method further comprises: determining a width and a height of the current block; in a case where the width of the current block is greater than or equal to a first threshold and the height of the current block is greater than or equal to a second threshold, performing the parsing of the bitstream to determine the value of the first syntax element of the current block; wherein the first threshold and the second threshold are equal or not equal.

3. The method according to any one of claims 1 to 2, wherein, The method further comprises: determining a width and a height of the current block; in a case where a product of the width and the height of the current block is greater than or equal to a third threshold, performing the parsing of the bitstream to determine the value of the first syntax element of the current block.

4. The method of claim 3, wherein, The third threshold is 32 or 64.

5. The method according to any one of claims 1 to 4, wherein, The method further comprises: obtaining prediction information used by one or more positions related to the current block; determining a value of a first variable of the current block based on the prediction information used by the one or more positions related to the current block; determining whether to allow performing the parsing of the bitstream to determine the value of the first syntax element of the current block based on the value of the first variable of the current block.

6. The method of claim 5, wherein, The obtaining the prediction information used by the one or more positions related to the current block comprises: determining a related block in which a related position is located based on the related position; obtaining prediction information of the related block as the prediction information used by the related position; or The obtaining the prediction information used by the one or more positions related to the current block comprises: obtaining the prediction information used by the related position based on the related position.

7. The method of claim 5, wherein The determining the value of the first variable of the current block based on the prediction information used by the one or more positions related to the current block comprises: in a case where the prediction information used by the one or more positions related to the current block satisfies a first condition, determining the value of the first variable to be a first value; in a case where the prediction information used by the one or more positions related to the current block does not satisfy the first condition, determining the value of the first variable to be a second value.

8. The method of claim 7, wherein The prediction information comprises a prediction mode identifier and / or a motion model identifier; The first condition comprises determining, based on the prediction mode identifier, that a prediction mode used by at least one of the related positions is a first prediction mode, and / or determining, based on the motion model identifier, that a motion model used by at least one of the related positions is an affine model.

9. The method of claim 7 or 8, wherein, The method further comprises: determining a width and a height of the current block; in a case where at least one of the width of the current block is less than a fourth threshold, the height of the current block is less than a fifth threshold, and a product of the width and the height of the current block is less than a sixth threshold is satisfied, performing the parsing of the bitstream to determine the value of the first syntax element of the current block.

10. The method of claim 5, wherein, The method further comprises: obtaining prediction information used by one or more positions related to the current block; determining a context index value of the first syntax element of the current block based on the prediction information used by the one or more positions related to the current block; 11. The method according to any one of claims 1 to 9, wherein, determining a context of the first syntax element based on the context index value; performing the parsing of the bitstream to determine the value of the first syntax element of the current block based on the context of the first syntax element.

12. The method of claim 11, wherein, the determining of the context index value of the first syntax element of the current block based on the prediction information used by the one or more positions related to the current block comprises: in a case where the prediction information used by the related position satisfies a second condition, determining a related value of the related position as a third value; in a case where the prediction information used by the related position does not satisfy the second condition, determining the related value of the related position as a fourth value; determining a value of a second variable of the current block based on the related values of the one or more positions related to the current block; determining the context index value of the first syntax element of the current block according to the value of the second variable of the current block.

13. The method of claim 12, wherein, the prediction information comprises a prediction mode identifier and / or a motion model identifier; the second condition comprises that the prediction mode identifier of the related position indicates that a prediction mode of the related position is a first prediction mode, and / or the motion model identifier of the related position indicates that a motion model of the related position is an affine model. the determining of the value of the second variable of the current block based on the related values of the one or more positions related to the current block comprises: performing a weighted operation based on the related values of the one or more positions related to the current block and a weight value to determine the value of the second variable of the current block. the determining of the context index value of the first syntax element of the current block according to the value of the second variable of the current block comprises:

14. The method of claim 12, wherein, in a case where the value of the second variable is less than or equal to a seventh threshold, determining the context index value as a first index value; ​ 15. The method of claim 12, wherein, ​ ​ the second variable is greater than the seventh threshold value and less than or equal to an eighth threshold value, the context index value is determined as a second index value; the second variable is greater than the eighth threshold value, the context index value is determined as a third index value.

16. The method of claim 8 or 13, wherein, the first prediction mode comprises at least one of a sub-block merge mode, an affine merge mode, an inter affine mode and a sub-block based temporal motion vector prediction mode; the affine model comprises at least one of a 4-parameter based affine model and a 6-parameter based affine model.

17. The method of any of claims 5-16, wherein, the one or more relevant positions relative to the current block comprise at least one of one or more neighboring positions of the current block within a current picture, one or more non-neighboring positions of the current block within the current picture, and one or more relevant positions of the current block within a reference picture.

18. The method of any of claims 5-17, wherein, the one or more relevant positions relative to the current block comprise at least one of a relevant position of the current block within a first range of the current picture based on a first search rule, and one or more relevant positions of the current block within a second range of the reference picture based on a second search rule.

19. The method of claim 18, wherein, the method further comprises one of: determining the first range of the current picture based on a position of the current block, and a width and a height of the current block; determining the first range of the current picture based on a position of the current block, and at least one of a preset width and a preset height of the first range; determining the first range of the current picture based on a position of the current block, a width and a height of the current block, and a preset width and a preset height of the first range.

20. The method of claim 18, wherein, the method further comprises one of: determining the second range of the reference picture based on a position of the collocated block of the current block, and a width and a height of the collocated block of the current block; determining the second range of the reference picture based on a position of the collocated block of the current block, and a preset width and a preset height of the second range; determining the second range of the reference picture based on a position of the collocated block of the current block, a width and a height of the collocated block of the current block, and a preset width and a preset height of the second range.

21. The method of claim 1, wherein, the method further comprises: in a case that a value of a third variable of the current block indicates that a maximum number of the sub-block merge candidate list is greater than 1, parsing a bitstream to determine an index value of the sub-block merge candidate list of the current block; the determining the motion information of the sub-block of the current block based on the sub-block merge candidate list of the current block comprises: determining the motion information of the sub-block of the current block based on the index value of the sub-block merge candidate list of the current block and the sub-block merge candidate list of the current block.

22. A method of encoding, applied to an encoder, the method comprising: in a case that a sub-block merge mode is allowed to be used for a current block, constructing a sub-block merge candidate list of the current block; determining motion information of a sub-block of the current block based on the sub-block merge candidate list of the current block; determining a prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block; making an encoding decision on the sub-block merge mode based on the prediction value of the sub-block of the current block, to determine a value of a first syntax element of the current block, the first syntax element being used to indicate whether the current block uses the sub-block merge mode; encoding the first syntax element of the current block, and writing the obtained encoding bits into a bitstream.

23. The method of claim 22, wherein, The method further includes: determining a width and a height of the current block; in a case where the width of the current block is greater than or equal to a first threshold value and the height of the current block is greater than or equal to a second threshold value, determining that the current block is allowed to use the sub-block merge mode; wherein the first threshold value and the second threshold value are equal or not equal.

24. The method of any one of claims 22-23, wherein, The method further includes: determining a width and a height of the current block; in a case where a product of the width and the height of the current block is greater than or equal to a third threshold value, determining that the current block is allowed to use the sub-block merge mode.

25. The method of claim 24, wherein, The third threshold value is 32 or 64.

26. The method of any one of claims 22 to 25, wherein, The method further includes: obtaining prediction information used by one or more positions related to the current block; determining a value of a first variable of the current block based on the prediction information used by the one or more positions related to the current block; determining whether the current block is allowed to use the sub-block merge mode based on the value of the first variable of the current block.

27. The method of claim 26, wherein, The obtaining the prediction information used by one or more positions related to the current block includes: based on the related position, determining a related block in which the related position is located; obtaining prediction information of the related block as the prediction information used by the related position; or The obtaining the prediction information used by one or more positions related to the current block includes: based on the related position, obtaining the prediction information used by the related position.

28. The method of claim 26, wherein The determining the value of the first variable of the current block based on the prediction information used by the one or more positions related to the current block includes: in a case where the prediction information used by the one or more positions related to the current block satisfies a first condition, determining that the value of the first variable is a first numerical value; in a case where the prediction information used by the one or more positions related to the current block does not satisfy the first condition, determining that the value of the first variable is a second numerical value.

29. The method of claim 28, wherein The prediction information includes a prediction mode identifier and / or a motion model identifier; The first condition includes determining, based on the prediction mode identifier, that a prediction mode used by at least one of the related positions is a first prediction mode, and / or determining, based on the motion model identifier, that a motion model used by at least one of the related positions is an affine model.

30. The method of claim 28 or 29, wherein, The determining whether the current block is allowed to use the sub-block merge mode based on the value of the first variable of the current block includes: the first variable of the current block is a first value, determining that the current block is allowed to use the sub-block merge mode; the first variable of the current block is a second value, determining that the current block is not allowed to use the sub-block merge mode.

31. The method of claim 26, wherein, The method further comprises: determining a width and a height of the current block; in a case where at least one of the width of the current block is less than a fourth threshold, the height of the current block is less than a fifth threshold, and a product of the width and the height of the current block is less than a sixth threshold is satisfied, determining that the current block is allowed to use the sub-block merge mode.

32. The method of any one of claims 22 to 31, wherein, The method further comprises: obtaining prediction information used at one or more positions related to the current block; based on the prediction information used at the one or more positions related to the current block, determining a context index value of the first syntax element of the current block; based on the context index value, determining a context of the first syntax element; based on the context of the first syntax element, performing encoding processing on the first syntax element of the current block, and writing obtained encoding bits into a bitstream.

33. The method of claim 32, wherein, the determining the context index value of the first syntax element of the current block based on the prediction information used at the one or more positions related to the current block comprises: in a case where the prediction information used at the related position satisfies a second condition, determining that a related value of the related position is a third value; in a case where the prediction information used at the related position does not satisfy the second condition, determining that the related value of the related position is a fourth value; based on the related values of the one or more positions related to the current block, determining a value of a second variable of the current block; determining the context index value of the first syntax element of the current block according to the value of the second variable of the current block.

34. The method of claim 33, wherein, the prediction information comprises a prediction mode identifier and / or a motion model identifier; the second condition comprises that the prediction mode identifier of the related position indicates that a prediction mode of the related position is a first prediction mode, and / or the motion model identifier of the related position indicates that a motion model of the related position is an affine model.

35. The method of claim 33, wherein, the determining the value of the second variable of the current block based on the related values of the one or more positions related to the current block comprises: based on the related values of the one or more positions related to the current block and a weight value, performing a weighted operation to determine the value of the second variable of the current block.

36. The method of claim 33, wherein, the determining the context index value of the first syntax element of the current block according to the value of the second variable of the current block comprises: in a case where the value of the second variable is less than or equal to a seventh threshold, determining that the context index value is a first index value; in a case where the value of the second variable is greater than the seventh threshold and less than or equal to an eighth threshold, determining that the context index value is a second index value; in a case where the value of the second variable is greater than the eighth threshold, determining that the context index value is a third index value.

37. The method of claim 29 or 34, wherein, The first prediction mode comprises at least one of a sub-block merge mode, an affine merge mode, an inter affine mode and a sub-block based temporal motion vector prediction mode. The affine model comprises at least one of a 4-parameter based affine model and a 6-parameter based affine model.

38. The method of any of claims 26-37, wherein, The one or more relevant positions of the current block comprise at least one of one or more neighboring positions of the current block within a current picture, one or more non-neighboring positions of the current block within the current picture, and one or more relevant positions of the current block within a reference picture.

39. The method of any of claims 26-38, wherein, The one or more relevant positions of the current block comprise at least one of a relevant position of the current block within a first range of a current picture based on a first search rule and one or more relevant positions of the current block within a second range of a reference picture based on a second search rule.

40. The method of claim 22, wherein, The method further comprises: determining an index value of the sub-block merge candidate list of the current block in a case that a value of the third variable of the current block indicates that a maximum number of the sub-block merge candidate list is greater than 1; encoding the index value of the sub-block merge candidate list and writing obtained encoding bits into a bitstream.

41. A bitstream, wherein, The bitstream is generated according to to-be-encoded information by bit encoding; wherein the to-be-encoded information comprises at least one of a first syntax element and an index value of a sub-block merge candidate list; wherein the first syntax element is used to indicate whether a sub-block merge mode is used for a current block.

42. An encoder comprising a first prediction unit, a first determination unit and an encoding unit; wherein: The first prediction unit is configured to construct a sub-block merge candidate list of a current block in a case that the current block is allowed to use a sub-block merge mode; determine motion information of sub-blocks of the current block based on the sub-block merge candidate list of the current block; determine prediction values of the sub-blocks of the current block based on the motion information of the sub-blocks of the current block; The first determination unit is configured to make an encoding decision on the sub-block merge mode based on the prediction values of the sub-blocks of the current block, and determine a value of a first syntax element of the current block, the first syntax element being used to indicate whether the sub-block merge mode is used for the current block; The encoding unit is configured to encode the first syntax element of the current block and write obtained encoding bits into a bitstream.

43. An encoder comprising a first memory and a first processor; wherein: The first memory is configured to store a computer program capable of running on the first processor; The first processor is configured to execute the method of any of claims 22-40 when running the computer program.

44. A decoder comprising a decoding unit and a second prediction unit; wherein: The decoding unit is configured to parse a bitstream and determine a value of a first syntax element of a current block, the first syntax element being used to indicate whether a sub-block merge mode is used for the current block; The second prediction unit, configured to construct a sub-block merge candidate list of the current block in a case that the value of the first syntax element indicates that the current block uses a sub-block merge mode; determine motion information of a sub-block of the current block based on the sub-block merge candidate list of the current block; determine a prediction value of the sub-block of the current block based on the motion information of the sub-block of the current block. 45.A decoder comprising a second memory and a second processor; wherein: the second memory is configured to store a computer program capable of running on the second processor; the second processor is configured to execute the method according to any one of claims 1 to 21 when running the computer program.

46. A computer readable storage medium, wherein, The computer readable storage medium stores the code stream generated by the encoding method according to any one of claims 22 to 40.

47. A computer readable storage medium, wherein, The computer readable storage medium stores a computer program which, when executed, implements the method according to any one of claims 1 to 21, or implements the method according to any one of claims 22 to 40.

Citation Information

Patent Citations

  • Method and device for processing video signal by using subblock-based motion compensation

    CN113196751A

  • Methods and apparatuses for signaling of merge modes in video coding

    US20220021894A1

  • Method and device for syntax signaling in video / image coding system

    US20220239918A1

  • Cabac context modeling with information from spatial neighbors

    US20230328249A1