# US 12,604,012 B2 · Coding method, encoder, and decoder

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

- Number: US 12,604,012 B2
- Document ID: US12604012B2
- Status: Granted
- Kind: B2
- Application number: 18/484,549
- Filed: 2023-10-11
- Published: 2024-02-15
- Granted: 2026-04-14
- Earliest claimed: 2021-04-12
- Assignees: Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Applicants: Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Inventors: Fan Wang; Zhihuang Xie
- Web page: https://patentgrep.com/patent/US12604012B2

## CPC

- H04N 19/13: Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/18: the unit being a set of transform coefficients
- H04N 19/184: the unit being bits, e.g. of the compressed video stream
- H04N 19/46: Embedding additional information in the video signal during the compression process (H04N19/517, H04N19/68, H04N19/70 take precedence)
- H04N 19/60: using transform coding
- H04N 19/70: characterised by syntax aspects related to video coding, e.g. related to compression standards
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Embodiments of the disclosure provide a coding method, an encoder, and a decoder. The decoder decodes a bitstream to determine a context mode flag of a current block, determines an initial value of a quantity parameter according to the context mode flag, and determines coefficients of the current block using at least one of a context mode or a bypass mode according to the initial value of the quantity parameter. The encoder determines the context mode flag of the current block, determines the initial value of the quantity parameter according to the context mode flag, and encodes the coefficients of the current block using at least one of the context mode or the bypass mode according to the initial value of the quantity parameter to generate the bitstream.

## Claims

### Claim 1

A decoding method, applied to a decoder and comprising:
decoding a bitstream to determine a context mode flag of a current block;
determining a height parameter and a width parameter of the current block;
based on a value of the context mode flag being a first value, determining an initial value of a quantity parameter according to the height parameter, the width parameter, and a first shift parameter; and
based on the value of the context mode flag being a second value, determining the initial value of the quantity parameter according to the height parameter, the width parameter, and a second shift parameter; and
determining coefficients of the current block using at least one of a context mode or a bypass mode according to the initial value of the quantity parameter,
wherein the first shift parameter and the second shift parameter each are used for right shifting, and the first shift parameter is greater than the second shift parameter.

### Claim 2 (depends on 1)

The method of claim 1, wherein the context mode flag is used for determining whether the context mode is used to determine the coefficients of the current block.

### Claim 3 (depends on 1)

The method of claim 1, wherein the context mode flag is used for determining whether the context mode is used to determine values of the coefficients of the current block.

### Claim 4 (depends on 1)

The method of claim 1, wherein determining the coefficients of the current block using at least one of the context mode or the bypass mode according to the initial value of the quantity parameter comprises:
determining the coefficients of the current block using the context mode, when the initial value of the quantity parameter is greater than or equal to a quantity threshold.

### Claim 5 (depends on 1)

The method of claim 1, wherein determining the coefficients of the current block using at least one of the context mode or the bypass mode according to the initial value of the quantity parameter comprises:
determining the coefficients of the current block using the bypass mode, when the initial value of the quantity parameter is less than a quantity threshold.

### Claim 6 (depends on 4)

The method of claim 4, wherein the quantity threshold is 4.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
decoding the bitstream to determine a video flag; and
executing a process of determining the context mode flag, when the video flag indicates that a video meets a preset condition;
wherein the preset condition comprises one of following conditions: high bit depth, high quality, high bitrate, high frame rate, or lossless compression.

### Claim 8 (depends on 1)

The method of claim 1, wherein the context mode flag is a flag of at least one of: a sequence level, a picture level, a slice level, or a block level.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
determining a coefficient sign flag using the bypass mode, when the value of the context mode flag is the first value.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
determining a sub-block coded flag of the current block using the bypass mode, when the value of the context mode flag is the first value.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
determining, using the bypass mode, prefix information for a horizontal coordinate of a last significant coefficient, prefix information for a vertical coordinate of the last significant coefficient, suffix information for the horizontal coordinate of the last significant coefficient, and suffix information for the vertical coordinate of the last significant coefficient corresponding to the current block, when the value of the context mode flag is the first value.

### Claim 12 (depends on 1)

The method of claim 1, wherein:
the first value is 1 and the second value is 0; or
the first value is set as true and the second value is set as false.

### Claim 13

An encoding method, applied to an encoder and comprising:
determining a context mode flag of a current block;
determining a height parameter and a width parameter of the current block;
based on a value of the context mode flag being a first value, determining an initial value of a quantity parameter according to the height parameter, the width parameter, and a first shift parameter; and
based on the value of the context mode flag being a second value, determining the initial value of the quantity parameter according to the height parameter, the width parameter, and a second shift parameter; and
encoding coefficients of the current block using at least one of a context mode or a bypass mode according to the initial value of the quantity parameter to generate a bitstream,
wherein the first shift parameter and the second shift parameter each are used for right shifting, and the first shift parameter is greater than the second shift parameter.

### Claim 14

A decoder, comprising:
a processor and a memory storing a computer program which, when executed by the processor, causes the processor to:
decode a bitstream to determine a context mode flag of a current block;
determine a height parameter and a width parameter of the current block;
based on a value of the context mode flag being a first value, determine an initial value of a quantity parameter according to the height parameter, the width parameter, and a first shift parameter; and
based on the value of the context mode flag being a second value, determine the initial value of the quantity parameter according to the height parameter, the width parameter, and a second shift parameter; and
determine coefficients of the current block using at least one of a context mode or a bypass mode according to the initial value of the quantity parameter,
wherein the first shift parameter and the second shift parameter each are used for right shifting, and the first shift parameter is greater than the second shift parameter.

### Claim 15 (depends on 13)

An encoder, comprising:
a processor and a memory storing a computer program which, when executed by the processor, causes the processor to perform the method of claim 13.

### Claim 16 (depends on 13)

The method of claim 13, wherein encoding the coefficients of the current block using at least one of the context mode or the bypass mode according to the initial value of the quantity parameter comprises:
encoding the coefficients of the current block using the context mode, when the initial value of the quantity parameter is greater than or equal to a quantity threshold.

### Claim 17 (depends on 13)

The method of claim 13, wherein encoding the coefficients of the current block using at least one of the context mode or the bypass mode according to the initial value of the quantity parameter comprises:
encoding the coefficients of the current block using the bypass mode, when the initial value of the quantity parameter is less than a quantity threshold.

### Claim 18 (depends on 17)

The method of claim 17, wherein the quantity threshold is 4.

### Claim 19 (depends on 13)

The method of claim 13, further comprising:
determining a video flag; and
executing a process of determining the context mode flag, when the video flag indicates that a video meets a preset condition;
wherein the preset condition comprises one of following conditions: high bit depth, high quality, high bitrate, high frame rate, or lossless compression.

### Claim 20 (depends on 13)

The method of claim 13, further comprising:
encoding, using the bypass mode, prefix information for a horizontal coordinate of a last significant coefficient, prefix information for a vertical coordinate of the last significant coefficient, suffix information for the horizontal coordinate of the last significant coefficient, and suffix information for the vertical coordinate of the last significant coefficient corresponding to the current block, when the value of the context mode flag is the first value.
