# US 2022/0295104 A1 · An apparatus, a method and a computer program for video coding and decoding

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

- Number: US 2022/0295104 A1
- Document ID: US20220295104A1
- Status: Published application
- Kind: A1
- Application number: 17/635,133
- Filed: 2020-09-09
- Published: 2022-09-15
- Earliest claimed: 2019-09-20
- Assignees: Nokia Technologies Oy
- Applicants: Nokia Technologies Oy
- Inventors: Jani LAINEMA
- Web page: https://patentgrep.com/patent/US20220295104A1

## CPC

- H04N 19/70: characterised by syntax aspects related to video coding, e.g. related to compression standards
- H04N 19/12: Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N 19/129: Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
- 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/60: using transform coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

There is disclosed a method comprising obtaining a block of transform coefficients; searching a position of a last non-zero coefficient in a scan order in the block; selecting a secondary transform mode based on the position and encoding first syntax elements indicative of the selected secondary transform mode. A primary transform mode is selected based on the secondary transform mode. Second syntax elements indicative of the selected primary transform mode and third syntax elements defining the transform coefficients within the block are encoded. There is also disclosed a method comprising receiving encoded information related to a block of transform coefficients; decoding an indication of a position of a last non-zero coefficient in a scan order in the block and using the position to determine if an indication of a secondary transform mode is present in the bit stream. If so, first syntax elements indicative of the secondary transform mode are decoded and used to determine if an indication of a primary transform mode is present in the bit stream. If so, second syntax elements indicative of the primary transform mode are decoded. The transform coefficients are decoded and the determined transform modes are applied to select transforms and the transforms, if any, are applied to the transform coefficients.

## Claims

### Claim at position 1

1-19. (canceled)

### Claim 20

An apparatus comprising at least one processor and at least one memory, said at least one memory stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform at least:
obtain a block of transform coefficients;
search a position of a last non-zero coefficient in a scan order in the block of transform coefficients;
select a secondary transform mode based on the position of the last non-zero coefficient;
encode first syntax elements indicative of the selected secondary transform mode;
select a primary transform mode based on the selected secondary transform mode;
encode second syntax elements indicative of the selected primary transform mode; and
encode third syntax elements defining the transform coefficients within the block.

### Claim 21 (depends on 20)

The apparatus according to claim 20, wherein said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform:
encode the first syntax elements indicative of the secondary transform mode when the position of the last non-zero coefficient is within a certain range in the scan order in the block.

### Claim 22 (depends on 20)

The apparatus according to claim 20, wherein to select the primary or secondary transform mode the apparatus is caused to:
test different transform modes;
evaluate cost functions for the tested different transform modes; and
select the transform mode which minimizes the selected cost function.

### Claim 23 (depends on 20)

The apparatus according to claim 20, wherein said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform:
omit signaling of some or all syntax elements relating to the primary transform mode when a non-zero secondary transform mode is included in a bitstream.

### Claim 24 (depends on 20)

The apparatus according claim 20, wherein said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform:
signal a transform skip mode when both primary and secondary transforms are by-passed before signaling the position of the last non-zero coefficient in the transform block.

### Claim 25 (depends on 20)

The apparatus according to claim 20, wherein said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform:
signal the position of the last non-zero coefficient; and
signal the first syntax elements indicative of the selected secondary transform mode after signaling the position of the last non-zero coefficient.

### Claim 26 (depends on 20)

The apparatus according to claim 20, wherein said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform:
signal the secondary transform to be off for the transform block;
signal the second syntax elements indicative of the selected primary transform mode after signaling the first syntax elements indicative of the selected secondary transform mode.

### Claim 27 (depends on 20)

The apparatus according to claim 20, wherein said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform:
signal syntax elements defining the coefficients of the transform block after signaling the second syntax elements indicative of the selected primary transform mode.

### Claim 28

A method comprising
obtaining a block of transform coefficients;
searching a position of a last non-zero coefficient in a scan order in the block of transform coefficients;
selecting a secondary transform mode based on the position of the last non-zero coefficient and encoding first syntax elements indicative of the selected secondary transform mode;
selecting a primary transform mode based on the selected secondary transform mode and encoding second syntax elements indicative of the selected primary transform mode; and
encoding third syntax elements defining the transform coefficients within the block.

### Claim 29 (depends on 28)

The method according to claim 28 further comprising:
encoding the first syntax elements indicative of the secondary transform mode if the position of the last non-zero coefficient is within a certain range in the scan order in the block.

### Claim 30 (depends on 28)

The method according to claim 28 further comprising:
omitting signaling of some or all syntax elements relating to the primary transform mode when a non-zero secondary transform mode is included in a bitstream.

### Claim 31 (depends on 28)

The method according to claim 28 further comprising:
signaling a transform skip mode when both primary and secondary transforms are by-passed before signaling the position of the last non-zero coefficient in the transform block.

### Claim 32 (depends on 28)

The method according to claim 28 further comprising:
signaling the position of the last non-zero coefficient; and
signaling the first syntax elements indicative of the selected secondary transform mode after signaling the position of the last non-zero coefficient.

### Claim 33

An apparatus comprising:
at least one processor and at least one memory, said at least one memory stored with code thereon, which when executed by said at least one processor, causes the apparatus to perform at least:
receive a bit stream comprising encoded information related to a block of transform coefficients;
decode from the bit stream an indication of a position of a last non-zero coefficient in a scan order in the block of transform coefficients;
use the position of the last non-zero coefficient to determine when an indication of a secondary transform mode is present in the bit stream;
when an indication of a secondary transform mode is present in the bit stream, determine the secondary transform mode by decoding first syntax elements indicative of the secondary transform mode;
use the determined secondary transform mode to determine when an indication of a primary transform mode is present in the bit stream;
when an indication of a primary transform mode is present in the bit stream, determine the primary transform mode by decoding second syntax elements indicative of the primary transform mode;
decode the transform coefficients;
apply the determined transform modes to select transforms; and
apply the determined transforms, to the transform coefficients.

### Claim 34 (depends on 33)

The apparatus according to claim 33, said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to:
omit decoding coefficient areas that are not applicable for the determined primary transform or a determined primary-secondary transform pair.

### Claim 35 (depends on 33)

The apparatus according to claim 33, said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to:
apply at least one of the primary transform and the secondary transform to one or more transform blocks following the transform block which included indication indicative of the at least one of the primary transform mode and the secondary transform mode.

### Claim 36 (depends on 33)

The apparatus according to claim 33, said at least one memory being stored with code thereon, which when executed by said at least one processor, causes the apparatus to:
decode from the bit stream the indication of a primary transform mode when a predetermined condition is fulfilled.

### Claim 37 (depends on 36)

The apparatus according to claim 36, wherein said predetermined condition includes one of:
a minimum dimension of the transform block; or
a maximum dimension of the transform block.

### Claim 38

A method comprising
receiving a bit stream comprising encoded information related to a block of transform coefficients;
decoding from the bit stream an indication of a position of a last non-zero coefficient in a scan order in the block of transform coefficients;
using the position of the last non-zero coefficient to determine when an indication of a secondary transform mode is present in the bit stream;
when an indication of a secondary transform mode is present in the bit stream, determining the secondary transform mode by decoding first syntax elements indicative of the secondary transform mode;
using the determined secondary transform mode to determine when an indication of a primary transform mode is present in the bit stream;
when an indication of a primary transform mode is present in the bit stream, determining the primary transform mode by decoding second syntax elements indicative of the primary transform mode;
decoding the transform coefficients;
applying the determined transform modes to select transforms; and apply the determined transforms, to the transform coefficients.

### Claim 39 (depends on 38)

The method according to claim 38, comprising:
omitting decoding coefficient areas that are not applicable for the determined primary transform or a determined primary-secondary transform pair.
