# US 2019/0356921 A1 · Efficient context handling in arithmetic coding

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

- Number: US 2019/0356921 A1
- Document ID: US20190356921A1
- Status: Published application
- Kind: A1
- Application number: 16/525,707
- Filed: 2019-07-30
- Published: 2019-11-21
- Earliest claimed: 2015-01-19
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Jaako Tuomas Aleksi Ventelae
- Web page: https://patentgrep.com/patent/US20190356921A1

## CPC

- H04N 19/13: Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
- H04N 19/129: Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
- H04N 19/134: characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N 19/136: Incoming video signal characteristics or properties
- H04N 19/18: the unit being a set of transform coefficients
- H04N 19/423: characterised by memory arrangements (H04N19/433 takes precedence)
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

An apparatus for decoding a current block in a scan order identifies a current entropy coded transform coefficient from the current block; determines, based on the scan order and using a scan order distance table, a first scan order distance, where the first scan order distance being a difference between a first scan order location corresponding to the current entropy coded transform coefficient and a second scan order location corresponding to a first context coefficient; identifies, using the first scan order distance, a first location into a context coefficient register; identifies, at the first location of the context coefficient register, a first context coefficient value; identifies a probability distribution using the first context coefficient value; entropy decodes the current entropy coded transform coefficient the probability distribution to obtain an entropy decoded current transform coefficient; and includes the entropy decoded current transform coefficient in an output bitstream.

## Claims

### Claim 1

An apparatus for decoding a current block in a scan order, the apparatus:
identifies a current entropy coded transform coefficient from the current block;
determines, based on the scan order and using a scan order distance table, a first scan order distance,
the first scan order distance being a difference between a first scan order location corresponding to the current entropy coded transform coefficient and a second scan order location corresponding to a first context coefficient;
identifies, using the first scan order distance, a first location into a context coefficient register;
identifies, at the first location of the context coefficient register, a first context coefficient value;
identifies a probability distribution using the first context coefficient value;
entropy decodes the current entropy coded transform coefficient the probability distribution to obtain an entropy decoded current transform coefficient; and
includes the entropy decoded current transform coefficient in an output bitstream.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein to entropy decode the current entropy coded transform coefficient, the apparatus:
determines, based on the scan order, a second scan order distance between the first scan order location corresponding to the current entropy coded transform coefficient and a scan order location corresponding to a second context coefficient, wherein the scan order location corresponding to the second context coefficient is spatially proximate to the first scan order location corresponding to the current entropy coded transform coefficient;
identifies a second context coefficient value from a second location in the context coefficient register, the second location corresponding to the second scan order distance; and
entropy decodes the current entropy coded transform coefficient based on the first context coefficient value and the second context coefficient value.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the first context coefficient is left of the current entropy coded transform coefficient, and the second context coefficient is above the current entropy coded transform coefficient.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the scan order distance table is a previously generated distance table.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the apparatus generates the scan order distance table for decoding the current block.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the scan order is a 32×32 scan order, and a size of the context coefficient register is 87.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the apparatus further:
determines a size for the context coefficient register as one less than a maximal scan order distance for the scan order.

### Claim 8 (depends on 1)

The apparatus of claim 1, wherein the apparatus further:
removes a most distantly decoded entropy decoded transform coefficient from the context coefficient register.

### Claim 9

An apparatus for entropy decoding a current entropy coded transform coefficient from a current block, the current block being decoded in a scan order, the scan order being non-contiguous, the apparatus:
determines, based on the scan order, a first scan order distance, the first scan order distance being a difference between a first scan order location corresponding to the current entropy coded transform coefficient and a second scan order location corresponding to a first context coefficient;
identifies a first context coefficient value from a first location in a context coefficient register, the first location corresponding to the first scan order distance;
determines, based on the scan order, a second scan order distance between the first scan order location corresponding to the current entropy coded transform coefficient and a scan order location corresponding to a second context coefficient, wherein the scan order location corresponding to the second context coefficient is spatially proximate to the first scan order location corresponding to the current entropy coded transform coefficient;
identifies a second context coefficient value from a second location in the context coefficient register, the second location corresponding to the second scan order distance;
entropy decodes, to obtain an entropy decoded current transform coefficient, the current entropy coded transform coefficient based on the first context coefficient value and the second context coefficient value;
includes the entropy decoded current transform coefficient in an output bitstream for display; and
performs a shift operation to include the entropy decoded current transform coefficient in the context coefficient register, wherein the context coefficient register is a first-in-first-out register and the entropy decoded current transform coefficient is added at a tail of the context coefficient register.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein the first context coefficient is left of the current entropy coded transform coefficient, and the second context coefficient is above the current entropy coded transform coefficient.

### Claim 11 (depends on 9)

The apparatus of claim 9, wherein the apparatus further:
identifies the first scan order distance and the second scan order distance from a scan order distance table for the scan order.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the apparatus further:
determines a size for the context coefficient register based on the scan order distance table.

### Claim 13 (depends on 11)

The apparatus of claim 11, wherein the scan order distance table is a previously generated distance table.

### Claim 14 (depends on 9)

The apparatus of claim 9, wherein the context coefficient register is sized as a function of a size of the current block.

### Claim 15 (depends on 9)

The apparatus of claim 9, wherein a size of the context coefficient register is one less than a maximal scan order distance for the scan order.

### Claim 16

An apparatus for decoding a current entropy coded transform coefficient of a current block, the current block being decoded using a scan order, the apparatus:
decodes entropy coded transform coefficients preceding the current entropy coded transform coefficient in the scan order to obtain respective preceding entropy decoded transform coefficients;
stores the respective preceding entropy decoded transform coefficients in a context coefficient register; context coefficient register;
determines, based on the scan order, a left scan order distance, the left scan order distance being a difference between a first scan order location corresponding to the current entropy coded transform coefficient and a second scan order location corresponding to a left context coefficient, wherein the left context coefficient is a first coefficient of the respective preceding entropy decoded transform coefficients;
determines, based on the scan order, an above scan order, the above scan order distance being a difference distance between the first scan order location corresponding to the current entropy coded transform coefficient and a third scan order location corresponding to an above context coefficient, wherein the above context coefficient is a second coefficient of the respective preceding entropy decoded transform coefficients;
reads the left context coefficient value from a first location of the context coefficient register, the first location corresponding to the left scan order distance;
reads the above context coefficient value from a second location of the context coefficient register, the second location corresponding to the above scan order distance;
selects a probability distribution using the left context coefficient value and the above context coefficient value;
entropy decodes, to obtain an entropy decoded current transform coefficient, the current entropy coded transform coefficient using the probability distribution; and
includes the entropy decoded current transform coefficient in an output bitstream.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the apparatus further:
identifies the left scan order distance and the above scan order distance from a scan order distance table for the scan order.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the apparatus further:
identifies the scan order distance table such that the scan order distance table includes a left context coefficient scan order distance and an above context coefficient scan order distance for each respective scan order location in the scan order.

### Claim 19 (depends on 16)

The apparatus of claim 16, wherein the scan order is a 32×32 scan order, and a size of the context coefficient register is 87.

### Claim 20 (depends on 16)

The apparatus of claim 16, wherein the apparatus further:
determines a size for the context coefficient register as one less than a maximal scan order distance for the scan order.
