# US 12,225,224 B2 · Methods for decoding or coding prediction mode, decoding or coding apparatus, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,225,224 B2
- Document ID: US12225224B2
- Status: Granted
- Kind: B2
- Application number: 17/614,141
- Filed: 2020-06-19
- Published: 2022-08-18
- Granted: 2025-02-11
- Earliest claimed: 2019-06-21
- Assignees: Hangzhou Hikvision Digital Technology Co., Ltd.
- Applicants: Hangzhou Hikvision Digital Technology Co., Ltd.
- Inventors: Fangdong Chen
- Web page: https://patentgrep.com/patent/US12225224B2

## CPC

- H04N 19/103: Selection of coding mode or of prediction mode
- H04N 19/46: Embedding additional information in the video signal during the compression process (H04N19/517, H04N19/68, H04N19/70 take precedence)
- H04N 19/109: among a plurality of temporal predictive coding modes
- H04N 19/137: Motion inside a coding unit, e.g. average field, frame or block difference
- H04N 19/157: Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N 19/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/44: Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
- H04N 19/50: using predictive coding (H04N19/61 takes precedence)
- H04N 19/51: Motion estimation or motion compensation
- H04N 19/52: by predictive encoding
- H04N 19/593: involving spatial prediction techniques
- H04N 19/70: characterised by syntax aspects related to video coding, e.g. related to compression standards
- H04N 19/105: Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
- H04N 19/107: between spatial and temporal predictive coding, e.g. picture refresh
- H04N 19/11: among a plurality of spatial predictive coding modes
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Provided is a method for decoding a prediction mode. In response to determining that a merge mode is enabled for a current block and a current candidate prediction mode is allowed for the current block, the method includes: acquiring enablement states of one or more to-be-traversed prediction modes; decoding indication information of the current candidate prediction mode from a code stream in response to determining that a candidate prediction mode being allowed is present in the to-be-traversed prediction modes; and directly determining that the current candidate prediction mode is used for the current block without decoding the indication information of the current candidate prediction mode from the code stream in response to determining that none of the to-be-traversed prediction modes is allowed.

## Claims

### Claim 1

A method for decoding a prediction mode comprising:
in response to determining that a merge mode is enabled for a current block and a current candidate prediction mode is allowed for the current block:
acquiring enablement states of one or more to-be-traversed prediction modes, wherein the one or more to-be-traversed prediction modes comprise at least one candidate prediction mode used for predicting the current block, the at least one candidate prediction mode being different than the current candidate prediction mode;
at a first time in response to determining that a candidate prediction mode being allowed is present in the one or more to-be-traversed prediction modes, decoding indication information of the current candidate prediction mode from a code stream, wherein the indication information is configured to indicate whether to enable the current candidate prediction mode for the current block; and
at a second time, in response to determining that none of the one or more to-be-traversed prediction modes is allowed, determining that the current candidate prediction mode is used for the current block without decoding the indication information of the current candidate prediction mode from the code stream,
wherein the method is executed by a processor.

### Claim 2 (depends on 1)

The method according to claim 1, wherein both the current candidate prediction mode and the candidate prediction mode in the to-be-traversed prediction modes are prediction modes based on the merge mode, and the prediction modes based on the merge mode at least comprise a regular merge mode, a merge mode with motion vector difference, a sub-block motion information based merge mode, or a combined inter-picture merge and intra-picture prediction mode.

### Claim 3 (depends on 1)

The method according to claim 1, wherein:
acquiring the enablement states of the to-be-traversed prediction modes comprises:
determining that none of the to-be-traversed prediction modes is allowed in response to determining that the current block does not meet a mode restriction condition of each candidate prediction mode in the to-be-traversed prediction modes, wherein the mode restriction condition comprises a size restriction condition, a restriction condition of other modes, a frame type restriction condition, and an enabled flag restriction condition; or
determining that the current candidate prediction mode is not used for the current block in response to determining that the current candidate prediction mode is not allowed for the current block, wherein it is determined that the current candidate prediction mode is not allowed for the current block in response to determining that the current block does not meet a mode restriction condition of the current candidate prediction mode, wherein the mode restriction condition comprises a size restriction condition, a restriction condition of other modes, a frame type restriction condition, and an enabled flag restriction condition; or
determining that the current candidate prediction mode is allowed for the current block by:
determining that the current candidate prediction mode is allowed for the current block in response to the current block meeting all mode restriction conditions for enabling the current candidate prediction mode; or
determining that any candidate prediction mode in the to-be-traversed prediction modes is allowed for the current block in response to the current block meeting all mode restriction conditions of the candidate prediction mode.

### Claim 4 (depends on 1)

The method according to claim 1, wherein:
in the case that the current candidate prediction mode is a combined inter-picture merge and intra-picture prediction mode, the method further comprises: determining that the combined inter-picture merge and intra-picture prediction mode is allowed for the current block, in response to an enabled flag for the combined inter-picture merge and intra-picture prediction mode being in an enabled state, an area of the current block being greater than or equal to 64, and both a height and a width of the current block being less than respective thresholds; and otherwise, determining that the combined inter-picture merge and intra-picture prediction mode is not allowed for the current block; or
in the case that the current candidate prediction mode is a combined inter-picture merge and intra-picture prediction mode, the method further comprises: determining that the combined inter-picture merge and intra-picture prediction mode is not used for the current block and setting a value of a mode flag bit of the combined inter-picture merge and intra-picture prediction mode to 0 in response to determining that the combined inter-picture merge and intra-picture prediction mode is not allowed for the current block; or
the method further comprises:
determining that the combined inter-picture merge and intra-picture prediction mode is not allowed for the current block, in response to a value of a sequence level enabled flag for the combined inter-picture merge and intra-picture prediction mode being 0, wherein the value of the sequence level enabled flag is present in a sequence parameter set; or
determining that the combined inter-picture merge and intra-picture prediction mode is not allowed for the current block, in response to a height or a width of the current block being equal to or greater than 128.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
directly setting a value of a mode flag bit of the current candidate prediction mode to 0 without decoding the mode flag bit of the current candidate prediction mode, in response to determining that the current candidate prediction mode is not allowed for the current block.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising:
determining that a combined inter-picture merge and intra-picture prediction mode is not allowed for the current block in response to the merge mode enabled for the current block belonging to a skip mode.

### Claim 7 (depends on 1)

The method according to claim 1, further comprising:
determining that a merge mode with motion vector difference is not allowed for the current block, in response to a value of a sequence level enabled flag for the merge mode with motion vector difference being 0, wherein the value of the sequence level enabled flag is present in a sequence parameter set.

### Claim 8 (depends on 1)

The method according to claim 1, further comprising:
determining that a sub-block motion information based merge mode is not allowed for the current block in response to a size of the current block being 4×8 or 8×4.

### Claim 9 (depends on 1)

The method according to claim 1, wherein in the case that the current candidate prediction mode is a combined inter-picture merge and intra-picture prediction mode and the to-be-traversed prediction modes comprise a first candidate prediction mode, the method further comprises:
determining whether the combined inter-picture merge and intra-picture prediction mode is allowed for the current block;
acquiring an enablement state of the current block for the first candidate prediction mode, in response to determining that the combined inter-picture merge and intra-picture prediction mode is allowed for the current block;
acquiring and decoding, in response to determining that the first candidate prediction mode is allowed for the current block, a flag bit of the combined inter-picture merge and intra-picture prediction mode;
determining whether to enable the combined inter-picture merge and intra-picture prediction mode for the current block based on decoded information of the flat bit, wherein the first candidate prediction mode is configured to predict, based on motion information of the current block, two triangular sub-blocks acquired by dividing the current block according to a preset angle, the preset angle comprising 45° or 135°; and
determining that the first candidate prediction mode is allowed for the current block by:
determining that the first candidate prediction mode is allowed for the current block, in response to determining that a regular merge mode, a merge mode with motion vector difference, a sub-block motion information based merge mode, and a combined inter-picture merge and intra-picture prediction mode are all disabled; or
in the case that the current candidate prediction mode is a combined inter-picture merge and intra-picture prediction mode and the to-be-traversed prediction modes comprise a first candidate prediction mode, the method further comprises:
determining whether the combined inter-picture merge and intra-picture prediction mode is allowed for the current block;
acquiring an enablement state of the current block for the first candidate prediction mode, in response to determining that the combined inter-picture merge and intra-picture prediction mode is allowed for the current block; and
directly determining that the combined inter-picture merge and intra-picture prediction mode is used for the current block without decoding flag bit, in response to determining that the first candidate prediction mode is not allowed for the current block, wherein the first candidate prediction mode is configured to predict, based on motion information of the current block, two triangular sub-blocks acquired by dividing the current block according to a preset angle, the preset angle comprising 45° or 135°; and
determining that the first candidate prediction mode is not allowed for the current block by:
determining that the first candidate prediction mode is not allowed for the current block in response to a value of a sequence level enabled flag for the first candidate prediction mode being 0, wherein the value of the sequence level enabled flag is present in a sequence parameter set; or determining that the first candidate prediction mode is not allowed for the current block in response to a current frame where the current block is located is a P frame.

### Claim 10

A method for coding a prediction mode comprising:
in response to determining that a merge mode is enabled for a current block and a current candidate prediction mode is allowed for the current block:
acquiring enablement states of one or more to-be-traversed prediction modes, wherein the one or more to-be-traversed prediction modes comprise at least one candidate prediction mode used for predicting the current block, the at least one candidate prediction mode being different than the current candidate prediction mode;
at a first time, in response to determining that a candidate prediction mode being allowed is present in the one or more to-be-traversed prediction modes, coding indication information of the current candidate prediction mode into a code stream, wherein the indication information is configured to indicate whether to enable the current candidate prediction mode for the current block; and
at a second time, in response to determining that none of the one or more to-be-traversed prediction modes is allowed, not coding the indication information of the current candidate prediction mode into the code stream,
wherein the method is executed by a processor.

### Claim 11 (depends on 10)

The method according to claim 10, wherein both the current candidate prediction mode and the candidate prediction mode in the to-be-traversed prediction modes are prediction modes based on the merge mode, and the prediction modes based on the merge mode at least comprise a regular merge mode, a merge mode with motion vector difference, a sub-block motion information based merge mode, or a combined inter-picture merge and intra-picture prediction mode; or
acquiring the enablement states of the to-be-traversed prediction modes comprises:
determining that none of the to-be-traversed prediction modes is allowed in response to determining that the current block does not meet a mode restriction condition of each candidate prediction mode in the to-be-traversed prediction modes, wherein the mode restriction condition comprises a size restriction condition, a restriction condition of other modes, a frame type restriction condition, and an enabled flag restriction condition.

### Claim 12 (depends on 10)

The method according to claim 10, further comprising:
determining that the current candidate prediction mode is not used for the current block in response to determining that the current candidate prediction mode is not allowed for the current block, wherein the current candidate prediction mode is not allowed for the current block in response determining that the current block does not meet a mode restriction condition of the current candidate prediction mode, wherein the mode restriction condition comprises a size restriction condition, a restriction condition of other modes, a frame type restriction condition, and an enabled flag restriction condition; or
in the case that the current candidate prediction mode is a combined inter-picture merge and intra-picture prediction mode, the method further comprises:
determining that the combined inter-picture merge and intra-picture prediction mode is allowed for the current block in response to an enabled flag for the combined inter-picture merge and intra-picture prediction mode being in an enabled state, an area of the current block being greater than or equal to 64, and both a height and a width of the current block being less than respective thresholds; and otherwise, determining that the combined inter-picture merge and intra-picture prediction mode is not allowed for the current block.

### Claim 13

A decoding apparatus comprising a processor configured to:
in response to determining that a merge mode is enabled for a current block and a current candidate prediction mode is allowed for the current block:
acquire enablement states of one or more to-be-traversed prediction modes, wherein the one or more to-be-traversed prediction modes comprise at least one candidate prediction mode used for predicting the current block, the at least one candidate prediction mode being different than the current candidate prediction mode;
in response to determining that a candidate prediction mode being allowed is present in the one or more to-be-traversed prediction modes, decode indication information of the current candidate prediction mode from a code stream, wherein the indication information is configured to indicate whether to enable the current candidate prediction mode for the current block; and
in response to determining that none of the one or more to-be-traversed prediction modes is allowed, determine that the current candidate prediction mode is used for the current block without decoding the indication information of the current candidate prediction mode from the code stream.

### Claim 14

A coding apparatus comprising a processor configured to:
in response to determining that a merge mode is enabled for a current block and a current candidate prediction mode is allowed for the current block:
acquire enablement states of one or more to-be-traversed prediction modes, wherein the one or more to-be-traversed prediction modes comprise at least one candidate prediction mode used for predicting the current block the at least one candidate prediction mode being different than the current candidate prediction mode;
in response to determining that a candidate prediction mode being allowed is present in the one of more to-be-traversed prediction modes, code indication information of the current candidate prediction mode into a code stream, wherein the indication information is configured to indicate whether to enable the current candidate prediction mode for the current block; and
in response to determining that none of the one or more to-be-traversed prediction modes is allowed, not code the indication information of the current candidate prediction mode into the code stream.

### Claim 15 (depends on 1)

A decoding device, comprising:
a processor; and
a memory configured to store one or more instructions executable by the processor;
wherein the instructions, when executed by the processor, cause the processor to perform the method of claim 1.

### Claim 16 (depends on 10)

A coding device, comprising:
a processor; and
a memory configured to store one or more instructions executable by the processor;
wherein the instructions, when executed by the processor, cause the processor to perform the method of claim 10.

### Claim 17 (depends on 1)

An electronic device, comprising:
a processor; and
a memory configured to store one or more instructions executable by the processor;
wherein the instructions, when executed by the processor, cause the processor to perform the method of claim 1.

### Claim 18 (depends on 10)

An electronic device, comprising:
a processor; and
a memory configured to store one or more instructions executable by the processor;
wherein the instructions, when executed by the processor, cause the processor to perform the of claim 10.

### Claim 19 (depends on 1)

A non-transitory computer-readable storage medium storing one or more instructions, wherein the one or more instructions, when executed by a processor of an electronic device, cause the processor to perform the method of claim 1.

### Claim 20 (depends on 10)

A non-transitory computer-readable storage medium storing one or more instructions, wherein the one or more instructions, when executed by a processor of an electronic device, cause the processor to perform the method of claim 10.
