# US 12,225,203 B2 · Motion vector obtaining method and apparatus, computer device, 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,225,203 B2
- Document ID: US12225203B2
- Status: Granted
- Kind: B2
- Application number: 18/066,578
- Filed: 2022-12-15
- Published: 2023-04-20
- Granted: 2025-02-11
- Earliest claimed: 2018-09-03
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Xu Chen; Jianhua Zheng
- Web page: https://patentgrep.com/patent/US12225203B2

## 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/139: Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
- 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/44: Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
- H04N 19/52: by predictive encoding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

This application discloses a motion vector obtaining method and apparatus, a computer device, and a storage medium. In the method, an initial motion vector of a to-be-processed picture block is determined by using a location relationship between a reference block and the to-be-processed picture block. When the reference block and the to-be-processed picture block are located in a same coding tree block, a decoder uses an initial motion vector of the reference block as the initial motion vector of the to-be-processed picture block. When the reference block and the to-be-processed picture block are located in different coding tree blocks, the decoder uses a final motion vector of the reference block as the initial motion vector of the to-be-processed picture block.

## Claims

### Claim 1

A method for determining motion vector residual, comprising:
obtaining identification information;
obtaining an initial motion vector of a coding unit of a picture based on the identification information;
obtaining a plurality of candidate final motion vectors based on the initial motion vector and a plurality of preset offset vectors;
obtaining a final motion vector from the plurality of candidate final motion vectors, wherein the final motion vector has a minimum distortion cost amongst the plurality of candidate final motion vectors, wherein the distortion cost is calculated by using a sum of absolute differences; and
calculating a difference between the final motion vector and the initial motion vector, wherein the difference represents a motion vector residual of a picture block to be processed,
wherein the final motion vector comprises a first forward motion vector and a first backward motion vector, and the initial motion vector comprises a second forward motion vector and a second backward motion vector; the first forward motion vector and the second forward motion vector indicate a motion compensation block based on a first reference frame list of the picture block, the distortion cost of the first forward motion vector is same as that of the first backward motion vector, and the first backward motion vector and the second backward motion vector indicate a motion compensation block based on a second reference frame list of the picture block.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the method is applied for an inter prediction mode.

### Claim 3

An encoder, comprising:
at least one processor; and
one or more memories coupled to the at least one processor and storing programming instructions, which when executed by the at least one processor, cause the encoder to:
obtain identification information;
obtain an initial motion vector of a coding unit of a picture based on the identification information;
obtain a plurality of candidate final motion vectors based on the initial motion vector and a plurality of preset offset vectors;
obtain a final motion vector from the plurality of candidate final motion vectors, wherein the final motion vector has a minimum distortion cost amongst the plurality of candidate final motion vectors, wherein the distortion cost is calculated by using a sum of absolute differences; and
calculate a difference between the final motion vector and the initial motion vector, wherein the difference represents a motion vector residual of a picture block to be processed,
wherein the final motion vector comprises a first forward motion vector and a first backward motion vector, and the initial motion vector comprises a second forward motion vector and a second backward motion vector; the first forward motion vector and the second forward motion vector indicate a motion compensation block based on a first reference frame list of the picture block, the distortion cost of the first forward motion vector is same as that of the first backward motion vector, and the first backward motion vector and the second backward motion vector indicate a motion compensation block based on a second reference frame list of the picture block.

### Claim 4 (depends on 3)

The encoder according to claim 3, wherein the encoder performs in an inter prediction mode.

### Claim 5

A coding apparatus, comprising:
at least one processor;
a memory for storing a bitstream having identification information, wherein the identification information is used to obtain an initial motion vector of a coding unit; and
an encoder operatively coupled to the memory and configured by the at least one processor to:
obtain identification information;
obtain an initial motion vector of a coding unit of a picture based on the identification information;
obtain a plurality of candidate final motion vectors based on the initial motion vector and a plurality of preset offset vectors;
obtain a final motion vector from the plurality of candidate final motion vectors, wherein the final motion vector has a minimum distortion cost amongst the plurality of candidate final motion vectors, wherein the distortion cost is calculated by using a sum of absolute differences; and
calculate a difference between the final motion vector and the initial motion vector, wherein the difference represents a motion vector residual of a picture block to be processed,
wherein the final motion vector comprises a first forward motion vector and a first backward motion vector, and the initial motion vector comprises a second forward motion vector and a second backward motion vector; the first forward motion vector and the second forward motion vector indicate a motion compensation block based on a first reference frame list of the picture block, the distortion cost of the first forward motion vector is same as that of the first backward motion vector, and the first backward motion vector and the second backward motion vector indicate a motion compensation block based on a second reference frame list of the picture block.

### Claim 6 (depends on 5)

The coding apparatus according to claim 5, wherein the encoder performs in an inter prediction mode.

### Claim 7 (depends on 1)

The method according to claim 1,
wherein the calculating a difference between the final motion vector and the initial motion vector comprises:
calculating a difference between the first forward motion vector and the second forward motion vector as a first motion vector residual of the picture block.

### Claim 8 (depends on 7)

The method according to claim 7, further comprising:
calculating a difference between the first backward motion vector and the second backward motion vector as a second motion vector residual of the picture block.

### Claim 9 (depends on 7)

The method according to claim 7, further comprising:
using the first forward motion vector as the first motion vector residual of the picture block.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising:
using the first backward motion vector as a second motion vector residual of the picture block.

### Claim 11 (depends on 3)

The encoder according to claim 3,
wherein the calculate a difference between the final motion vector and the initial motion vector comprises:
calculate a difference between the first forward motion vector and the second forward motion vector as a first motion vector residual of the picture block.

### Claim 12 (depends on 11)

The encoder according to claim 11, wherein the programming instructions, which when executed by the at least one processor, cause the encoder further to:
calculate a difference between the first backward motion vector and the second backward motion vector as a second motion vector residual of the picture block.

### Claim 13 (depends on 11)

The encoder according to claim 11, wherein the programming instructions, which when executed by the at least one processor, cause the encoder further to:
use the first forward motion vector as the first motion vector residual of the picture block.

### Claim 14 (depends on 13)

The encoder according to claim 13, wherein the programming instructions, which when executed by the at least one processor, cause the encoder further to:
use the first backward motion vector as a second motion vector residual of the picture block.

### Claim 15 (depends on 5)

The coding apparatus according to claim 5,
wherein the calculate a difference between the final motion vector and the initial motion vector comprises:
calculate a difference between the first forward motion vector and the second forward motion vector as a first motion vector residual of the picture block.

### Claim 16 (depends on 15)

The coding apparatus according to claim 15, wherein the encoder is configured to:
calculate a difference between the first backward motion vector and the second backward motion vector as a second motion vector residual of the picture block.

### Claim 17 (depends on 15)

The coding apparatus according to claim 15, wherein the encoder is configured to:
use the first forward motion vector as the first motion vector residual of the picture block.

### Claim 18 (depends on 17)

The coding apparatus according to claim 17, wherein the encoder is configured to:
use the first backward motion vector as a second motion vector residual of the picture block.
