# US 12,603,996 B2 · Using template matching for refining candidate selection

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

- Number: US 12,603,996 B2
- Document ID: US12603996B2
- Status: Granted
- Kind: B2
- Application number: 18/684,790
- Filed: 2022-08-18
- Published: 2024-10-24
- Granted: 2026-04-14
- Earliest claimed: 2021-08-19
- Assignees: MediaTek Singapore Pte. Ltd.
- Applicants: MediaTek Singapore Pte. Ltd.
- Inventors: Olena Chubach; Chun-Chia Chen; Man-Shu Chiang; Tzu-Der Chuang; Ching-Yeh Chen; Chih-Wei Hsu; Yu-Wen Huang
- Web page: https://patentgrep.com/patent/US12603996B2

## 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/119: Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
- H04N 19/146: Data rate or code amount at the encoder output
- H04N 19/147: according to rate distortion criteria (rate-distortion as a criterion for motion estimation H04N19/567)
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/196: being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters (processing of motion vectors H04N19/513)
- H04N 19/513: Processing of motion vectors
- H04N 19/521: {for estimating the reliability of the determined motion vectors or motion vector field, e.g. for smoothing the motion vector field or for correcting motion vectors}
- H04N 19/96: Tree coding, e.g. quad-tree coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A video coding system that uses template matching (TM) to improve signaling of coding modes is provided. The system receives data to be encoded or decoded as a current block of a current picture of a video. The system identifies a set of pixels neighboring the current block as a current template. The system identifies a reference template of each candidate coding mode in a plurality of candidate coding modes. The system computes a template matching (TM) cost for each candidate coding mode based on matching the current template with the reference template of the candidate coding mode. The system selects a candidate coding mode from the plurality of candidate coding modes based on the computed TM costs. The system reconstructs the current block or encoding the current block into a bitstream by using selected candidate coding mode.

## Claims

### Claim 1

A video coding method comprising:
receiving data to be encoded or decoded as a current block of a current picture of a video;
identifying a set of pixels neighboring the current block as a current template;
identifying a reference template of each candidate coding mode in a plurality of candidate coding modes, wherein the plurality of candidate coding modes correspond to a plurality of reference picture indices that identify reference pictures in a reference picture list for generating a prediction for encoding or decoding the current block;
computing a template matching (TM) cost for each candidate coding mode based on matching the current template with the reference template of the candidate coding mode;
selecting a candidate coding mode from the plurality of candidate coding modes based on the computed TM costs; and
reconstructing the current block or encoding the current block into a bitstream by using selected candidate coding mode.

### Claim 2 (depends on 1)

The video coding method of claim 1, wherein the plurality of candidate coding modes correspond to a plurality of different partitioning modes that each partitions the current block into a plurality of partitions, each partition having a corresponding current template and a reference template that is identified by a motion vector associated with the partition, wherein the TM cost of a candidate coding mode is computed based on the current templates and the reference templates of the plurality of partitions that are created from the current block by the candidate coding mode.

### Claim 3 (depends on 2)

The video coding method of claim 2, wherein the TM costs of the different partitioning modes are computed based on a same set of motion vector differences (MVDs).

### Claim 4 (depends on 2)

The video coding method of claim 2, wherein the plurality of different partitioning modes comprises partitioning modes that partitions the current block vertically and partitioning modes that partitions the current block horizontally.

### Claim 5 (depends on 2)

The video coding method of claim 2, wherein the plurality of different partitioning modes comprises partitioning modes that partitions the current block symmetrically and partitioning modes that partitions the current block asymmetrically.

### Claim 6 (depends on 2)

The video coding method of claim 2, wherein the plurality of different partitioning modes comprises partitioning modes that partitions the current block into two partitions and partitioning modes that partitions the current block into more than two partitions.

### Claim 7 (depends on 2)

The video coding method of claim 2, wherein a direction of the partitioning is not signaled to a video decoder.

### Claim 8 (depends on 1)

The video coding method of claim 1, further comprising reordering the plurality of reference picture indices based on TM costs computed for the plurality of candidate coding modes and signaling or receiving a reordered reference picture index for identifying a reference picture.

### Claim 9 (depends on 1)

The video coding method of claim 1, wherein the plurality of candidate coding modes correspond to a plurality of bidirectional weighting indices that identify different weighting options for two motion vectors in bidirectional prediction for the current block.

### Claim 10 (depends on 9)

The video coding method of claim 9, further comprising reordering the plurality of bidirectional weighting indices based on TM costs computed for the plurality of candidate coding modes and signaling or receiving a reordered bidirectional weighting index for identifying a weighting option for the two motion vectors.

### Claim 11

An electronic apparatus comprising:
a video decoder or encoder circuit configured to perform operations comprising:
receiving data to be encoded or decoded as a current block of a current picture of a video;
identifying a set of pixels neighboring the current block as a current template;
identifying a reference template of each candidate coding mode in a plurality of candidate coding modes, wherein the plurality of candidate coding modes correspond to a plurality of reference picture indices that identify reference pictures in a reference picture list for generating a prediction for encoding or decoding the current block;
computing a template matching (TM) cost for each candidate coding mode based on matching the current template with the reference template of the candidate coding mode;
selecting a candidate coding mode from the plurality of candidate coding modes based on the computed TM costs; and
reconstructing the current block or encoding the current block into a bitstream by using selected candidate coding mode.
