# US 12,225,188 B2 · Prediction method for decoding and apparatus, and computer 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,188 B2
- Document ID: US12225188B2
- Status: Granted
- Kind: B2
- Application number: 18/328,705
- Filed: 2023-06-02
- Published: 2023-09-28
- Granted: 2025-02-11
- Earliest claimed: 2018-12-25
- Assignees: Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Applicants: Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Inventors: Junyan Huo; Yanzhuo Ma; Shuai Wan; Fuzheng Yang; Xinwei Li
- Web page: https://patentgrep.com/patent/US12225188B2

## CPC

- 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/186: the unit being a colour or a chrominance component
- H04N 19/132: Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A prediction method, apparatus, and a computer storage medium for encoding, the method includes: acquiring reference samples adjacent to at least one side of a coding block; determining a reference point from the at least one side and determining reference sample positions corresponding to the at least one side according to a preset number of samples; deriving reference samples corresponding to the reference sample positions from the reference samples; and performing prediction on the coding block based on the derived reference samples.

## Claims

### Claim 1

A prediction method for encoding, comprising:
acquiring reference samples adjacent to at least one side of a coding block;
determining a reference point from the at least one side and determining reference sample positions corresponding to the at least one side according to a preset number of samples;
deriving reference samples corresponding to the reference sample positions from the reference samples; and
performing prediction on the coding block based on the derived reference samples, wherein the performing prediction comprises:
determining model parameters of a prediction model based on the derived reference samples, wherein the prediction model is configured to represent a prediction relationship between a first colour component and a second colour component corresponding to a sample in the coding block; and
performing prediction on the coding block based on the prediction model;
wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the preset number of samples comprises:
calculating a first sampling interval based on the preset number of samples and a length of the at least one side; and
determining the reference point from the at least one side, and determining the reference sample positions corresponding to the at least one side according to the first sampling interval.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining the model parameters of the prediction model based on the derived reference samples comprises:
determining, from the derived reference samples, a maximum Lmax and minimum Lmin of first colour component neighbouring reference values and second colour component neighbouring reference values Cmax and Cmin corresponding to reference samples at positions corresponding to Lmax and Lmin; and
calculating model parameters according to Lmax, Lmin, Cmax and Cmin by using the formula (3):
{
α
=
L
max
-
L
min
C
max
-
C
min
β
=
L
min
-
α
·
C
min
(
3
)
where α and β represent model parameters.

### Claim 3 (depends on 1)

The method of claim 1, wherein the at least one side comprises at least one of a left side or an upper side of the coding block.

### Claim 4 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side comprises:
based on the length of the at least one side, responsive to that a midpoint of the at least one side is at a middle position between two reference samples, determining a first reference sample position on the right of the middle position as the reference point of the at least one side, or determining a first reference sample position on the left of the middle position as the reference point of the at least one side.

### Claim 5 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side comprises:
based on the length of the at least one side, responsive to that a midpoint of the at least one side is at a middle position between two reference samples, determining a first reference sample position lower than the middle position as the reference point of the at least one side, or determining a first reference sample position upper than the middle position as the reference point of the at least one side.

### Claim 6 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the first sampling interval comprises:
calculating a midpoint value of the at least one side based on the length of the at least one side;
calculating reference sample positions according to the midpoint value and the first sampling interval; and
when the midpoint value is non-integral, rounding down a reference sample position on a left side of the midpoint value and determining the rounded reference sample position as a reference sample position, rounding up a reference sample position on a right side of the midpoint value and determining the rounded reference sample position as the reference sample position.

### Claim 7 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the first sampling interval comprises:
calculating a midpoint value of the at least one side based on the length of the at least one side;
calculating reference sample positions according to the midpoint value and the first sampling interval; and
when the midpoint value is non-integral, rounding up a reference sample position on the left side of the midpoint value and determining the rounded reference sample position as a reference sample position, rounding down a reference sample position on the right side of the midpoint value and determining the rounded reference sample position as the reference sample position.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
regulating the first sampling interval to obtain a second sampling interval; and
determining the reference point from the at least one side, and determining the reference sample positions corresponding to the at least one side according to the second sampling interval.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
determining the reference point from the at least one side, determining a reference sample position corresponding to a left side of the reference point according to the first sampling interval, and determining a reference sample position corresponding to a right side of the reference point according to the second sampling interval.

### Claim 10 (depends on 1)

The method of claim 1, wherein calculating the first sampling interval based on the preset number of samples and the length of the at least one side comprises:
calculating the first sampling interval based on the preset number of samples and the length of the at least one side by using the formula (1):
Δ=length/(N2/2) (4)
where Δ represents the first sampling interval, length represents the length of the at least one side, and N2 represents the preset number of samples;
determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the first sampling interval comprises:
calculating a starting position of reference samples according to the first sampling interval by using the formula (2); and
determining the reference sample positions corresponding to the at least one side according to the starting position of reference samples and the first sampling interval;
shift=Δ/2 (5)
where shift represents a starting position of the reference samples.

### Claim 11 (depends on 10)

The method of claim 10, wherein determining the reference sample positions corresponding to the at least one side according to the starting position of the reference samples and the first sampling interval comprises:
determining the reference sample positions corresponding to the at least one side to be 2, 6, 10 and 14 when the starting position of the reference samples is 2 and the sampling interval is 4.

### Claim 12 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the preset number of samples comprises:
determining, when the length of the at least one side is 8 and the preset number of samples is 2, the reference sample positions corresponding to the at least one side to be 2 and 6, or 1 and 5, or 1 and 6, or 2 and 5.

### Claim 13 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the preset number of samples comprises:
determining the reference point from the at least one side, and determining continuous reference sample positions near the reference point as the reference sample positions according to the preset number of samples, the reference point being at a middle position of the reference sample positions.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
determining, when the length of the at least one side is 8 and the preset number of samples is 3, the reference sample positions corresponding to the at least one side to be 2, 3 and 4, or 3,4 and 5.

### Claim 15 (depends on 1)

The method of claim 1, wherein the coding block comprises a square coding block or a non-square coding block.

### Claim 16 (depends on 1)

The method of claim 1, wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the preset number of samples comprises:
acquiring, from the reference samples, remaining reference samples except reference samples corresponding to a starting position and ending position of the at least one side; and
determining the reference point from the at least one side, and determining the reference sample positions based on the remaining reference samples and the preset number of samples.

### Claim 17

A prediction device for encoding, comprising a memory and a processor, wherein
the memory is configured to store a computer program capable of running in the processor; and
the processor is configured to run the computer program to execute a prediction method for encoding, comprising:
acquiring reference samples adjacent to at least one side of a coding block;
determining a reference point from the at least one side and determining reference sample positions corresponding to the at least one side according to a preset number of samples;
deriving reference samples corresponding to the reference sample positions from the reference samples; and
performing prediction on the coding block based on the derived reference samples, wherein the performing prediction comprises:
determining model parameters of a prediction model based on the derived reference samples, wherein the prediction model is configured to represent a prediction relationship between a first colour component and a second colour component corresponding to a sample in the coding block; and
performing prediction on the coding block based on the prediction model;
wherein the processor is further configured to:
calculate a first sampling interval based on the preset number of samples and a length of the at least one side; and
determine the reference point from the at least one side, and determining the reference sample positions corresponding to the at least one side according to the first sampling interval.

### Claim 18 (depends on 17)

The device of claim 17, wherein determining the model parameters of the prediction model based on the derived reference samples comprises:
determining, from the derived reference samples, a maximum Lmax and minimum Lmin of first colour component neighbouring reference values and second colour component neighbouring reference values Cmax and Cmin corresponding to reference samples at positions corresponding to Lmax and Lmin; and
calculating model parameters according to Lmax, Lmin, Cmax and Cmin by using the formula (3):
{
α
=
L
max
-
L
min
C
max
-
C
min
β
=
L
min
-
α
·
C
min
(
3
)
where α and β represent model parameters.

### Claim 19

A non-transitory computer storage medium, storing a prediction program for encoding, wherein the prediction program for encoding is executed by at least one processor to implement a prediction method for encoding, comprising:
acquiring reference samples adjacent to at least one side of a coding block;
determining a reference point from the at least one side and determining reference sample positions corresponding to the at least one side according to a preset number of samples;
deriving reference samples corresponding to the reference sample positions from the reference samples; and
performing prediction on the coding block based on the derived reference samples, wherein the performing prediction comprises:
determining model parameters of a prediction model based on the derived reference samples, wherein the prediction model is configured to represent a prediction relationship between a first colour component and a second colour component corresponding to a sample in the coding block; and
performing prediction on the coding block based on the prediction model;
wherein determining the reference point from the at least one side and determining the reference sample positions corresponding to the at least one side according to the preset number of samples comprises:
calculating a first sampling interval based on the preset number of samples and a length of the at least one side; and
determining the reference point from the at least one side, and determining the reference sample positions corresponding to the at least one side according to the first sampling interval.
