# US 10,455,229 B2 · Prediction mode selection method, apparatus and device

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

- Number: US 10,455,229 B2
- Document ID: US10455229B2
- Status: Granted
- Kind: B2
- Application number: 15/684,940
- Filed: 2017-08-24
- Published: 2017-12-07
- Granted: 2019-10-22
- Earliest claimed: 2015-05-08
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Xunan Mao
- Web page: https://patentgrep.com/patent/US10455229B2

## CPC

- H04N 19/11: among a plurality of spatial predictive coding modes
- H04N 19/147: according to rate distortion criteria (rate-distortion as a criterion for motion estimation H04N19/567)
- H04N 19/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/186: the unit being a colour or a chrominance component
- H04N 19/194: involving only two passes
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Provided are a prediction mode selection method, apparatus and system related to the field of video coding. The method includes: selecting, for the current prediction unit, a first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes, performing a prediction residual cost calculation on each candidate intra-frame chromaticity prediction mode in the first group to obtain a difference evaluation value, selecting a second group of candidate intra-frame chromaticity prediction modes from the first group of candidate intra-frame chromaticity prediction modes according to the difference evaluation values, performing a coding cost calculation on each candidate intra-frame chromaticity prediction mode in the second group to obtain a coding cost value; and determining, according to the coding cost values, one of the candidate intra-frame chromaticity prediction modes in the second group that has a lowest coding cost, as an intra-frame chromaticity prediction mode of the current prediction unit.

## Claims

### Claim 1

A prediction mode selection method, comprising:
selecting, for a current prediction unit, a first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes, wherein N is a positive integer;
performing a prediction residual cost calculation on each candidate intra-frame chromaticity prediction mode in the first group to obtain a difference evaluation value;
selecting a second group of candidate intra-frame chromaticity prediction modes from the first group of candidate intra-frame chromaticity prediction modes according to the difference evaluation values, wherein the second group of candidate intra-frame chromaticity prediction modes is a proper subset of the first group of candidate intra-frame chromaticity prediction modes;
performing a coding cost calculation on each candidate intra-frame chromaticity prediction mode in the second group to obtain a coding cost value; and
determining, according to the coding cost values, one of the candidate intra-frame chromaticity prediction modes in the second group that has a lowest coding cost, as an intra-frame chromaticity prediction mode of the current prediction unit;
wherein selecting the second group of candidate intra-frame chromaticity prediction modes from the first group of candidate intra-frame chromaticity prediction modes according to the difference evaluation values comprises:
sequencing the first group of candidate intra-frame chromaticity prediction modes in an ascending order of the difference evaluation values to obtain n1 sequenced candidate intra-frame chromaticity prediction modes;
determining whether first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include an intra-frame brightness prediction mode of the current prediction unit, wherein n2 is smaller than n1;
selecting the first n2 prediction modes as the second group of candidate intra-frame chromaticity prediction modes if the first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode of the current prediction unit;
selecting the first n2 prediction modes and the intra-frame brightness prediction mode as the second group of candidate intra-frame chromaticity prediction modes if the first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes do not include the intra-frame brightness prediction mode of the current prediction unit.

### Claim 2 (depends on 1)

The method according to claim 1, wherein selecting, for the current prediction unit, the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes comprises:
selecting the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes according to an intra-frame brightness prediction mode of the current prediction unit.

### Claim 3 (depends on 2)

The method according to claim 2, wherein selecting the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes according to the intra-frame brightness prediction mode of the current prediction unit comprises:
taking a Planar mode, a Direct Current (DC) mode and a horizontal prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the horizontal prediction mode;
taking the Planar mode, the DC mode and a vertical prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the vertical prediction mode;
taking the Planar mode, the DC mode, a first direction prediction mode and the horizontal prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the first direction prediction mode and an included angle between a first direction corresponding to the first direction prediction mode and the horizontal direction is smaller than or equal to a first angle;
taking the Planar mode, the DC mode, a second direction prediction mode and the vertical prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the second direction prediction mode and an included angle between a second direction corresponding to the second direction prediction mode and the vertical direction is smaller than or equal to a second angle;
taking the Planar mode, the DC mode, the horizontal prediction mode, the vertical prediction mode and a third direction prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the third direction prediction mode, an included angle between a third direction corresponding to the third direction prediction mode and the horizontal direction is greater than the first angle and an included angle between the third direction and the vertical direction is greater than the second angle,
wherein the first direction, the second direction and the third direction each refer to any one of 33 directions ranging from ang_2 direction to ang_34 direction except the horizontal direction and the vertical direction.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising: before determining whether the first nz prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode of the current prediction unit,
determining whether the n1 sequenced candidate intra-frame chromaticity prediction modes include an ang_34 direction prediction mode and whether the ang_34 direction prediction mode is not the prediction mode sequenced as the leading one;
deleting the ang_34 direction prediction mode from the n1 sequenced candidate intra-frame chromaticity prediction modes if the n1 sequenced candidate intra-frame chromaticity prediction modes include the ang_34 direction prediction mode and the ang_34 direction prediction mode is not the prediction mode sequenced as the leading one;
determining whether the first nz prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode if the n1 sequenced candidate intra-frame chromaticity prediction modes do not include the ang_34 direction prediction mode or if the n1 sequenced candidate intra-frame chromaticity prediction modes include the ang_34 direction prediction mode but the ang_34 direction prediction mode is the prediction mode sequenced as the leading one.

### Claim 5

A video coding device, comprising:
one or more processors; and
a memory in which one or more programs are stored, wherein the one or more programs are configured to be executed by the one or more processors and comprise instructions for executing the following operations of:
selecting, for a current prediction unit, a first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes, wherein N is a positive integer;
performing a prediction residual cost calculation on each candidate intra-frame chromaticity prediction mode in the first group to obtain a difference evaluation value;
selecting a second group of candidate intra-frame chromaticity prediction modes from the first group of candidate intra-frame chromaticity prediction modes according to the difference evaluation values, wherein the second group of candidate intra-frame chromaticity prediction modes is a proper subset of the first group of candidate intra-frame chromaticity prediction modes;
performing a coding cost calculation on each candidate intra-frame chromaticity prediction mode in the second group to obtain a coding cost value; and
determining, according to the coding cost values, one of the candidate intra-frame chromaticity prediction modes in the second group that has a lowest coding cost, as an intra-frame chromaticity prediction mode of the current prediction unit;
wherein the one or more programs further include instructions for executing the following operations of:
sequencing the first group of candidate intra-frame chromaticity prediction modes in an ascending order of the difference evaluation values to obtain n1 sequenced candidate intra-frame chromaticity prediction modes;
determining whether first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include an intra-frame brightness prediction mode of the current prediction unit, wherein n2 is smaller than n1;
selecting the first n2 prediction modes as the second group of candidate intra-frame chromaticity prediction modes if the first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode of the current prediction unit;
selecting the first n2 prediction modes and the intra-frame brightness prediction mode as the second group of candidate intra-frame chromaticity prediction modes if the first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes do not include the intra-frame brightness prediction mode of the current prediction unit.

### Claim 6 (depends on 5)

The device according to claim 5, wherein the one or more programs further comprise instructions for executing the following operation of:
selecting the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes according to an intra-frame brightness prediction mode of the current prediction unit.

### Claim 7 (depends on 6)

The device according to claim 6, wherein the one or more programs further comprise instructions for executing the following operations of:
taking a Planar mode, a Direct Current (DC) mode and a horizontal prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the horizontal prediction mode;
taking the Planar mode, the DC mode and a vertical prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the vertical prediction mode;
taking the Planar mode, the DC mode, a first direction prediction mode and the horizontal prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the first direction prediction mode and an included angle between a first direction corresponding to the first direction prediction mode and the horizontal direction is smaller than or equal to a first angle;
taking the Planar mode, the DC mode, a second direction prediction mode and the vertical prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the second direction prediction mode and an included angle between a second direction corresponding to the second direction prediction mode and the vertical direction is smaller than or equal to a second angle;
taking the Planar mode, the DC mode, the horizontal prediction mode, the vertical prediction mode and a third direction prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the third direction prediction mode, an included angle between a third direction corresponding to the third direction prediction mode and the horizontal direction is greater than the first angle and an included angle between the third direction and the vertical direction is greater than the second angle,
wherein the first direction, the second direction and the third direction each refer to any one of 33 directions ranging from ang_2 direction to ang_34 direction except the horizontal direction and the vertical direction.

### Claim 8 (depends on 5)

The device according to claim 5, wherein the one or more programs further include instructions for executing the following operations of:
determining whether n1 sequenced candidate intra-frame chromaticity prediction modes include an ang_34 direction prediction mode and whether the ang_34 direction prediction mode is not the prediction mode sequenced as the leading one;
deleting the ang_34 direction prediction mode from the n1 sequenced candidate intra-frame chromaticity prediction modes if the n1 sequenced candidate intra-frame chromaticity prediction modes include the ang_34 direction prediction mode and the ang_34 direction prediction mode is not the prediction mode sequenced as the leading one;
determining whether the first nz prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode if the n1 sequenced candidate intra-frame chromaticity prediction modes do not include the ang_34 direction prediction mode or if the n1 sequenced candidate intra-frame chromaticity prediction modes include the ang_34 direction prediction mode but the ang_34 direction prediction mode is the prediction mode sequenced as the leading one.

### Claim 9

A non-transitory computer-readable storage medium having stored therein instructions that, when executed by a processor of a video coding device, cause the video coding device to perform a prediction mode selection method, the method comprising:
selecting, for a current prediction unit, a first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes, wherein N is a positive integer;
performing a prediction residual cost calculation on each candidate intra-frame chromaticity prediction mode in the first group to obtain a difference evaluation value;
selecting a second group of candidate intra-frame chromaticity prediction modes from the first group of candidate intra-frame chromaticity prediction modes according to the difference evaluation values, wherein the second group of candidate intra-frame chromaticity prediction modes is a proper subset of the first group of candidate intra-frame chromaticity prediction modes;
performing a coding cost calculation on each candidate intra-frame chromaticity prediction mode in the second group to obtain a coding cost value; and
determining, according to the coding cost values, one of the candidate intra-frame chromaticity prediction modes in the second group that has a lowest coding cost, as an intra-frame chromaticity prediction mode of the current prediction unit;
wherein selecting the second group of candidate intra-frame chromaticity prediction modes from the first group of candidate intra-frame chromaticity prediction modes according to the difference evaluation values comprises:
sequencing the first group of candidate intra-frame chromaticity prediction modes in an ascending order of the difference evaluation values to obtain n1 sequenced candidate intra-frame chromaticity prediction modes;
determining whether first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include an intra-frame brightness prediction mode of the current prediction unit, wherein n2 is smaller than n1;
selecting the first n2 prediction modes as the second group of candidate intra-frame chromaticity prediction modes if the first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode of the current prediction unit;
selecting the first n2 prediction modes and the intra-frame brightness prediction mode as the second group of candidate intra-frame chromaticity prediction modes if the first n2 prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes do not include the intra-frame brightness prediction mode of the current prediction unit.

### Claim 10 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein selecting, for the current prediction unit, the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes comprises:
selecting the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes according to an intra-frame brightness prediction mode of the current prediction unit.

### Claim 11 (depends on 10)

The non-transitory computer-readable storage medium according to claim 10, wherein selecting the first group of candidate intra-frame chromaticity prediction modes from N intra-frame prediction modes according to the intra-frame brightness prediction mode of the current prediction unit comprises:
taking a Planar mode, a Direct Current (DC) mode and a horizontal prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the horizontal prediction mode;
taking the Planar mode, the DC mode and a vertical prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the vertical prediction mode;
taking the Planar mode, the DC mode, a first direction prediction mode and the horizontal prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the first direction prediction mode and an included angle between a first direction corresponding to the first direction prediction mode and the horizontal direction is smaller than or equal to a first angle;
taking the Planar mode, the DC mode, a second direction prediction mode and the vertical prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the second direction prediction mode and an included angle between a second direction corresponding to the second direction prediction mode and the vertical direction is smaller than or equal to a second angle;
taking the Planar mode, the DC mode, the horizontal prediction mode, the vertical prediction mode and a third direction prediction mode as the first group of candidate intra-frame chromaticity prediction modes if the intra-frame brightness prediction mode is the third direction prediction mode, an included angle between a third direction corresponding to the third direction prediction mode and the horizontal direction is greater than the first angle and an included angle between the third direction and the vertical direction is greater than the second angle,
wherein the first direction, the second direction and the third direction each refer to any one of 33 directions ranging from ang_2 direction to ang_34 direction except the horizontal direction and the vertical direction.

### Claim 12 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein the method further comprises: before determining whether the first nz prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode of the current prediction unit,
determining whether the n1 sequenced candidate intra-frame chromaticity prediction modes include an ang_34 direction prediction mode and whether the ang_34 direction prediction mode is not the prediction mode sequenced as the leading one;
deleting the ang_34 direction prediction mode from the n1 sequenced candidate intra-frame chromaticity prediction modes if the n1 sequenced candidate intra-frame chromaticity prediction modes include the ang_34 direction prediction mode and the ang_34 direction prediction mode is not the prediction mode sequenced as the leading one;
determining whether the first nz prediction modes in the n1 sequenced candidate intra-frame chromaticity prediction modes include the intra-frame brightness prediction mode if the n1 sequenced candidate intra-frame chromaticity prediction modes do not include the ang_34 direction prediction mode or if the n1 sequenced candidate intra-frame chromaticity prediction modes include the ang_34 direction prediction mode but the ang_34 direction prediction mode is the prediction mode sequenced as the leading one.
