# US 12,771,850 B2 · Encoding and decoding method 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,771,850 B2
- Document ID: US12771850B2
- Status: Granted
- Kind: B2
- Application number: 18/989,311
- Filed: 2024-12-20
- Published: 2025-04-17
- Granted: 2026-10-20
- Earliest claimed: 2022-07-04
- Assignees: Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Applicants: Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Inventors: Zhihuang Xie
- Web page: https://patentgrep.com/patent/US12771850B2

## CPC

- H04N 19/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- 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/176: the region being a block, e.g. a macroblock
- H04N 19/61: in combination with predictive coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A decoding method is provided. A bitstream is decoded to determine a prediction mode parameter. The bitstream is decoded to determine a matrix-based intra prediction (MIP) parameter of a current block, in response to the prediction mode parameter indicating that MIP is used to determine an intra prediction value. The bitstream is decoded to determine transform coefficients of the current block and a low-frequency non-separable transform (LFNST) index of the current block. A mapping mode of an LFNST transform set is determined according to the MIP parameter, in response to the LFNST index indicating that an LFNST is used for the current block. According to the mapping mode of the LFNST transform set, one LFNST transform kernel candidate set is selected from a plurality of LFNST transform kernel candidate sets, and an LFNST transform kernel used for the current block is determined from the selected LFNST transform kernel candidate set.

## Claims

### Claim 1

A decoding method, applicable to a decoder and comprising:
decoding a bitstream to determine a prediction mode parameter;
determining a matrix-based intra prediction (MIP) parameter of a current block, in response to the prediction mode parameter indicating that MIP is used to determine an intra prediction value, wherein the MIP parameter comprises a size parameter of the current block;
determining transform coefficients of the current block and a low-frequency non-separable transform (LFNST) index of the current block;
determining a mapping mode of an LFNST transform set using decoder side intra mode derivation (DIMD) in response to the size parameter not satisfying a first preset condition, wherein the mapping mode of the LFNST transform set is an intra prediction mode mapped to the LFNST transform set;
selecting, according to the mapping mode of the LFNST transform set, one LFNST transform kernel candidate set from a plurality of LFNST transform kernel candidate sets, and determining, according to the LFNST index, an LFNST transform kernel used for the current block from the selected LFNST transform kernel candidate set; and
transforming the transform coefficients using the LFNST transform kernel.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining a downsampling vector of the current block according to the MIP parameter;
performing matrix multiplication calculation according to the downsampling vector, to obtain an MIP output vector;
for the MIP output vector, traversing at least one intra prediction mode to obtain at least one gradient information;
determining a gradient amplitude value corresponding to each intra prediction mode according to the at least one gradient information; and
determining, among the at least one intra prediction mode, an intra prediction mode with a largest gradient amplitude value as the mapping mode of the LFNST transform set.

### Claim 3 (depends on 1)

The method of claim 1, wherein the size parameter comprises a height and a width of the current block, and the method further comprises:
determining that the size parameter does not satisfy the first preset condition, in response to the height of the current block being less than a preset height threshold and/or the width of the current block being less than a preset width threshold.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
determining an index of the mapping mode of the LFNST transform set;
determining a value of an LFNST intra prediction mode index according to a value of the index;
selecting, according to the value of the LFNST intra prediction mode index, one LFNST transform kernel candidate set from the plurality of LFNST transform kernel candidate sets; and
selecting, from the selected LFNST transform kernel candidate set, a transform kernel indicated by the LFNST index and setting the transform kernel indicated by the LFNST index as the LFNST transform kernel used for the current block.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
the plurality of LFNST transform kernel candidate sets comprises 35 LFNST transform kernel candidate sets, wherein each LFNST transform kernel candidate set comprises 3 LFNST transform kernels; and
determining an index of an LFNST transform kernel candidate set corresponding to the LFNST intra prediction mode index using a second look-up table.

### Claim 6 (depends on 5)

The method of claim 5, wherein the MIP parameter comprises an MIP transpose indication parameter, and a value of the MIP transpose indication parameter indicates whether to transpose a sample input vector used in the MIP mode.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
performing matrix-transpose on the transform kernel indicated by the LFNST index to obtain the LFNST transform kernel used for the current block, in response to the value of the MIP transpose indication parameter indicating to transpose the sample input vector used in the MIP mode.

### Claim 8

An encoding method, applicable to an encoder and comprising:
determining a prediction mode parameter;
determining a matrix-based intra prediction (MIP) parameter of a current block, in response to the prediction mode parameter indicating that MIP is used for the current block to determine an intra prediction value, wherein the MIP parameter comprises a size parameter of the current block;
determining an intra prediction block of the current block according to the MIP parameter, and calculating a residual block obtained by subtracting the intra prediction value from the current block;
determining a mapping mode of a low-frequency non-separable transform (LFNST) transform set using decoder side intra mode derivation (DIMD) in response to the size parameter not satisfying a first preset condition, wherein the mapping mode of the LFNST transform set is an intra prediction mode mapped to the LFNST transform set;
selecting, according to the mapping mode of the LFNST transform set, one LFNST transform kernel candidate set from a plurality of LFNST transform kernel candidate sets, determining an LFNST transform kernel used for the current block from the selected LFNST transform kernel candidate set, and setting an LFNST index and signalling the LFNST index into a video bitstream; and
transforming the residual block using the LFNST transform kernel.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
determining a downsampling vector of the current block according to the MIP parameter;
performing matrix multiplication calculation according to the downsampling vector, to obtain an MIP output vector;
for the MIP output vector, traversing at least one intra prediction mode to obtain at least one gradient information;
determining a gradient amplitude value corresponding to each intra prediction mode according to the at least one gradient information; and
determining, among the at least one intra prediction mode, an intra prediction mode with a largest gradient amplitude value as the mapping mode of the LFNST transform set.

### Claim 10 (depends on 8)

The method of claim 8, wherein the size parameter comprises a height and a width of the current block, and the method further comprises:
determining that the size parameter does not satisfy the first preset condition, in response to the height of the current block being less than a preset height threshold and/or the width of the current block being less than a preset width threshold.

### Claim 11 (depends on 8)

The method of claim 8, further comprising:
determining an index of the mapping mode of the LFNST transform set;
determining a value of an LFNST intra prediction mode index according to a value of the index;
selecting, according to the value of the LFNST intra prediction mode index, one LFNST transform kernel candidate set from the plurality of LFNST transform kernel candidate sets; and
selecting, from the selected LFNST transform kernel candidate set, a transform kernel used for the current block.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
the plurality of LFNST transform kernel candidate sets comprises 35 LFNST transform kernel candidate sets, wherein each LFNST transform kernel candidate set comprises 3 LFNST transform kernels; and accordingly
determining an index of an LFNST transform kernel candidate set corresponding to the LFNST intra prediction mode index using a second look-up table.

### Claim 13 (depends on 12)

The method of claim 12, wherein the MIP parameter comprises an MIP transpose indication parameter, and a value of the MIP transpose indication parameter indicates whether to transpose a sample input vector used in the MIP mode.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
performing matrix-transpose on the selected transform kernel to obtain the LFNST transform kernel used for the current block, in response to the value of the MIP transpose indication parameter indicating to transpose the sample input vector used in the MIP mode.

### Claim 15

A non-transitory computer-readable storage medium storing a computer program and a bitstream, wherein when executed by a processor, the computer program causes the processor to implement an encoding method to generate the bitstream, the encoding method comprising:
determining a prediction mode parameter;
determining a matrix-based intra prediction (MIP) parameter of a current block, in response to the prediction mode parameter indicating that MIP is used for the current block to determine an intra prediction value, wherein the MIP parameter comprises a size parameter of the current block;
determining an intra prediction block of the current block according to the MIP parameter, and calculating a residual block obtained by subtracting the intra prediction value from the current block;
determining a mapping mode of a low-frequency non-separable transform (LFNST) transform set using decoder side intra mode derivation (DIMD) in response to the size parameter not satisfying a first preset condition, wherein the mapping mode of the LFNST transform set is an intra prediction mode mapped to the LFNST transform set;
selecting, according to the mapping mode of the LFNST transform set, one LFNST transform kernel candidate set from a plurality of LFNST transform kernel candidate sets, determining an LFNST transform kernel used for the current block from the selected LFNST transform kernel candidate set, and setting an LFNST index and signalling the LFNST index into a video bitstream; and
transforming the residual block using the LFNST transform kernel.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, further comprising:
determining a downsampling vector of the current block according to the MIP parameter;
performing matrix multiplication calculation according to the downsampling vector, to obtain an MIP output vector;
for the MIP output vector, traversing at least one intra prediction mode to obtain at least one gradient information;
determining a gradient amplitude value corresponding to each intra prediction mode according to the at least one gradient information; and
determining, among the at least one intra prediction mode, an intra prediction mode with a largest gradient amplitude value as the mapping mode of the LFNST transform set.

### Claim 17 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the size parameter comprises a height and a width of the current block, further comprising:
determining that the size parameter does not satisfy the first preset condition, in response to the height of the current block being less than a preset height threshold and/or the width of the current block being less than a preset width threshold.
