# US 2022/0295090 A1 · Motion candidate derivation

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

- Number: US 2022/0295090 A1
- Document ID: US20220295090A1
- Status: Published application
- Kind: A1
- Application number: 17/200,632
- Filed: 2021-03-12
- Published: 2022-09-15
- Earliest claimed: 2021-03-12
- Assignees: Lemon Inc.
- Applicants: Lemon Inc.
- Inventors: Na ZHANG; Kai ZHANG; Hongbin LIU; Li ZHANG; Yue WANG
- Web page: https://patentgrep.com/patent/US20220295090A1

## CPC

- H04N 19/513: Processing of motion vectors
- H04N 19/52: by predictive encoding
- 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/132: Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
- H04N 19/137: Motion inside a coding unit, e.g. average field, frame or block difference
- 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/533: Motion estimation using multistep search, e.g. two-dimensional [2D]-log search or one-at-a-time search [OTS]
- H04N 19/56: Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Embodiments of the present disclosure provide methods, apparatuses and computer storage media for video processing. One example method comprises determining, during a conversion between a current video block of a video and a bitstream of the video, a motion candidate for the current video block; refining the motion candidate by performing a local search around the motion candidate based on a template matching cost rule; and performing the conversion based on the refined motion candidate, wherein a search order of the local search is related to a coding mode of the current video block.

## Claims

### Claim 1

A video processing method, comprising:
determining, during a conversion between a current video block of a video and a bitstream of the video, a motion candidate for the current video block;
refining the motion candidate by performing a local search around the motion candidate based on a template matching cost rule; and
performing the conversion based on the refined motion candidate,
wherein a search order of the local search is related to a coding mode of the current video block, and wherein the search order specifies that the local search is performed from coarse granularity to fine granularity.

### Claim 2 (depends on 1)

The video processing method of claim 1, wherein if the coding mode is a merge mode, the search order is one of the following:
integer sample offset searching followed by quarter sample offset searching followed by one-sixteenth sample offset searching;
integer sample offset searching followed by quarter sample offset searching;
integer sample offset searching followed by half sample offset searching followed by quarter sample offset searching followed by one-sixteenth sample offset searching;
integer sample offset searching followed by half sample offset searching followed by quarter sample offset searching followed by one-eighth sample offset searching followed by one-sixteenth sample offset searching; or
integer sample offset searching followed by half sample offset searching followed by quarter sample offset searching.

### Claim 3 (depends on 1)

The video processing method of claim 1, wherein if the coding mode is a motion vector predication mode, the search order is one of the following:
integer sample offset searching followed by quarter sample offset searching followed by one-sixteenth sample offset searching;
integer sample offset searching followed by quarter sample offset searching; or
integer sample offset searching followed by half sample offset searching followed by quarter sample offset searching.

### Claim 4 (depends on 1)

The video processing method of claim 1, wherein performing the local search comprises:
determining a starting search point for the local search based on a template of the current video block and motion information indicated by the motion candidate;
performing a first round of integer sample offset searching from the starting search point based on a first search pattern, wherein the first round of the integer sample offset searching is terminated in response to a first search point acting as a center point of the first search pattern and associated with a minimum template matching cost being found;
performing a second round of the integer sample offset searching from the first search point based on a second search pattern, wherein the second round of the integer sample offset searching is terminated in response to a second search point associated with the minimum template matching cost being found; and
determining the refined motion candidate based on the second search point.

### Claim 5 (depends on 4)

The video processing method of claim 4, wherein determine the refined motion candidate based on the second search point comprises:
in response to the local search comprising no fractional sample offset searching, determining the refined motion candidate corresponding to the second search point.

### Claim 6 (depends on 4)

The video processing method of claim 4, wherein determining the refined motion candidate based on the second search point comprises:
in response to the local search comprising fractional sample offset searching,
performing the fractional sample offset searching from the second search point based on the second search pattern, to determine a final search point associated with the minimum template matching cost during the fractional sample offset searching; and
determining the refined motion candidate corresponding to the final search point.

### Claim 7 (depends on 4)

The video processing method of claim 4, wherein the first search pattern is an unrestricted center-biased diamond search pattern and the second search pattern is a cross search pattern.

### Claim 8 (depends on 1)

The video processing method of claim 1, wherein a search range of the local search is determined based on a predetermined number of luminance samples.

### Claim 9 (depends on 1)

The video processing method of claim 1, wherein the local search comprises integer sample offset searching and fractional sample offset searching, and performing the local search comprises:
determining an integer sample offset for the integer sample offset searching;
performing the integer sample offset searching based on the integer sample offset;
determining a fractional sample offset for the fractional sample offset searching by using a parametric error surface equation; and
performing the fractional sample offset searching based on a result of the integer sample offset searching and the fractional sample offset.

### Claim 10 (depends on 9)

The video processing method of claim 9, wherein the integer sample offset searching is terminated in response to a search point associated with a minimum template matching cost being found, and determining the fractional sample offset comprises:
using a template matching cost of the search point and respective template matching costs of a plurality of neighboring search points to fit the parametric error surface equation; and
determining the fractional sample offset by solving the parametric error surface equation based on the minimum template matching cost.

### Claim 11 (depends on 9)

The video processing method of claim 9, wherein performing the fractional sample offset searching comprises:
in response to the integer sample offset searching being terminated with a search point associated with a minimum template matching cost being found, performing the fractional sample offset searching to derive the refined motion candidate by adding the fractional sample offset to a motion candidate corresponding to the search point.

### Claim 12 (depends on 1)

The video processing method of claim 1, wherein the video processing method is only performed at CU-level.

### Claim 13 (depends on 1)

The video processing method of claim 1, wherein the video processing method is applied for a Luma component.

### Claim 14 (depends on 1)

The video processing method of claim 1, wherein the video processing method is applied for at least one Chroma component.

### Claim 15 (depends on 1)

The video processing method of claim 1, wherein different template shapes and/or different matching rules are applied for different components.

### Claim 16 (depends on 1)

The video processing method of claim 1, wherein the conversion comprises encoding the current video block into the bitstream.

### Claim 17 (depends on 1)

The video processing method of claim 1, wherein the conversion comprises decoding the current video block from the bitstream.

### Claim 18

An apparatus for processing video data comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to:
determine, during a conversion between a current video block of a video and a bitstream of the video, a motion candidate for the current video block;
refine the motion candidate by performing a local search around the motion candidate based on a template matching cost rule; and
perform the conversion based on the refined motion candidate,
wherein a search order of the local search is related to a coding mode of the current video block, and wherein the search order specifies that the local search is performed from coarse granularity to fine granularity.

### Claim 19

A non-transitory computer-readable storage medium storing instructions that cause a processor to:
determine, during a conversion between a current video block of a video and a bitstream of the video, a motion candidate for the current video block;
refine the motion candidate by performing a local search around the motion candidate based on a template matching cost rule; and
perform the conversion based on the refined motion candidate,
wherein a search order of the local search is related to a coding mode of the current video block, and wherein the search order specifies that the local search is performed from coarse granularity to fine granularity.

### Claim 20

A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by a video processing apparatus, wherein the method comprises:
determining, during a conversion between a current video block of a video and a bitstream of the video, a motion candidate for the current video block;
refining the motion candidate by performing a local search around the motion candidate based on a template matching cost rule; and
performing the conversion based on the refined motion candidate,
wherein a search order of the local search is related to a coding mode of the current video block, and wherein the search order specifies that the local search is performed from coarse granularity to fine granularity.

### Claim 21 (depends on 1)

The video processing method of claim 1, wherein a precision of a finest granularity is aligned with a precision of a motion vector used in motion prediction or aligned with a precision of a stored motion vector.

### Claim 22 (depends on 3)

The video processing method of claim 3, wherein during the local search, one or more precisions of offsets are allowed to be skipped.
