# US 2021/0289220 A1 · Picture Encoding and Decoding Method and Apparatus for Video Sequence

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

- Number: US 2021/0289220 A1
- Document ID: US20210289220A1
- Status: Published application
- Kind: A1
- Application number: 17/334,068
- Filed: 2021-05-28
- Published: 2021-09-16
- Earliest claimed: 2018-11-30
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Xu Chen; Jianhua Zheng
- Web page: https://patentgrep.com/patent/US20210289220A1

## CPC

- H04N 19/44: Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
- H04N 19/59: involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution
- 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/503: involving temporal prediction (adaptive coding with adaptive selection between spatial and temporal predictive coding H04N19/107; adaptive coding with adaptive selection among a plurality of temporal predictive coding modes H04N19/109)
- H04N 19/513: Processing of motion vectors
- H04N 19/523: with sub-pixel accuracy
- H04N 19/56: Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search
- H04N 19/577: Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A picture decoding method includes determining motion information of a to-be-decoded block, obtaining a first decoding prediction block of the to-be-decoded block based on the motion information, performing motion search with first precision in the prediction reference picture block to obtain at least two second decoding prediction blocks, performing downsampling on the first decoding prediction block and the at least two second decoding prediction blocks to obtain a first sampling pixel array and at least two second sampling pixel arrays, respectively, calculating a difference between the first sampling pixel array and each of the second sampling pixel arrays, setting, as a target prediction motion vector, a motion vector corresponding to a second sampling pixel array with a minimum difference, obtaining a target decoding prediction block of the to-be-decoded block based on the target prediction motion vector, and decoding the to-be-decoded block based on the target decoding prediction block.

## Claims

### Claim 1

A method comprising:
determining motion information of a to-be-decoded block, wherein the motion information comprises a prediction motion vector and reference picture information, and wherein the reference picture information identifies a prediction reference picture block;
obtaining a first decoding prediction block of the to-be-decoded block based on the motion information;
performing a motion search with a first precision in the prediction reference picture block to obtain second decoding prediction blocks, wherein a search position of the motion search is based on the prediction motion vector and the first precision;
performing downsampling on the first decoding prediction block to obtain a first sampling pixel array;
performing downsampling on the second decoding prediction blocks to obtain second sampling pixel arrays;
calculating a first difference between the first sampling pixel array and each of the second sampling pixel arrays;
setting, as a target prediction motion vector of the to-be-decoded block, a motion vector between the to-be-decoded block and a second decoding prediction block of the second decoding prediction blocks, wherein the second decoding prediction block corresponds to a second sampling pixel array of the second sampling pixel arrays that is with a minimum difference of first differences;
obtaining a target decoding prediction block of the to-be-decoded block based on the target prediction motion vector; and
decoding the to-be-decoded block based on the target decoding prediction block.

### Claim 2 (depends on 1)

The method of claim 1, wherein the method comprises:
calculating a first sum of absolute values of pixel differences of pixels at corresponding locations in the first sampling pixel array and each of the second sampling pixel arrays, and setting the first sum as the first difference; or
calculating a second sum of squares of pixel differences, and setting the second sum as the first difference.

### Claim 3 (depends on 1)

The method of claim 1, wherein the second decoding prediction blocks comprise a base block, an upper block, a lower block, a left block, and a right block, and wherein the method comprises:
excluding the lower block from the second decoding prediction blocks when a second difference corresponding to the upper block is less than a third difference corresponding to the base block;
excluding the upper block from the second decoding prediction blocks when a fourth difference corresponding to the lower block is less than the third difference;
excluding the right block from the second decoding prediction blocks when a fifth difference corresponding to the left block is less than the third difference; or
excluding the left block from the second decoding prediction blocks when a sixth difference corresponding to the right block is less than the third difference.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
obtaining an upper left block in the prediction reference picture block based on a first prediction vector when the lower block and the right block are excluded, wherein a first position indicated by the first prediction vector is based on shifting a second position indicated by the prediction motion vector leftward by a target offset and upward by the target offset, wherein the upper left block is one of the second decoding prediction blocks, and wherein the target offset is based on the first precision;
obtaining an upper right block in the prediction reference picture block based on a second prediction vector when the lower block and the left block are excluded, wherein a third position indicated by the second prediction vector is based on shifting the second position rightward by the target offset and upward by the target offset, and wherein the upper right block is one of the second decoding prediction blocks;
obtaining a lower right block in the prediction reference picture block based on a third prediction vector when the upper block and the left block are excluded, wherein a fourth position indicated by the third prediction vector is based on shifting the second position rightward by the target offset and downward by the target offset, and wherein the lower right block is one of the second decoding prediction blocks; and
obtaining a lower left block in the prediction reference picture block based on a fourth prediction vector when the upper block and the right block are excluded, wherein a fifth position indicated by the fourth prediction vector is based on shifting the second position leftward by the target offset and downward by the target offset, and wherein the lower left block is one of the second decoding prediction blocks.

### Claim 5 (depends on 1)

The method of claim 1, wherein the second decoding prediction blocks comprise an upper block, a lower block, a left block, and a right block, and wherein the method further comprises:
obtaining an upper left block in the prediction reference picture block based on a first prediction vector when a second difference corresponding to the upper block is less than a third difference corrsponding to the lower block and when a fourth difference corresponding to the left block is less than a fifth difference corresponding to the right block, wherein a first position indicated by the first prediction vector is based on shifting a second position indicated by the prediction motion vector leftward by a target offset and upward by the target offset, wherein the upper left block is one of the second decoding prediction blocks, and wherein the target offset is based on the first precision;
obtaining an upper right block in the prediction reference picture block based on a second prediction vector when the second difference is less than thrd difference and when the fifth difference is less than fourth difference, wherein a third position indicated by the second prediction vector is based on shifting the second position rightward by the target offset and upward by the target offset, and wherein the upper right block is one of the second decoding prediction blocks;
obtaining a lower right block in the prediction reference picture block based on a third prediction vector when the third difference is less than the second difference and when the fifth difference is less than the fourth difference, wherein a fourth position indicated by the third prediction vector is based on shifting the second position rightward by the target offset and downward by the target offset, and wherein the lower right block is one of the second decoding prediction blocks; and
obtaining a lower left block in the prediction reference picture block based on a fourth prediction vector when the third difference is less than the second difference and when the fourth difference corresponding to the left block is less than a difference corresponding to the right block, wherein a fifth position indicated by the fourth prediction vector is based on shifting the second position leftward by the target offset and downward by the target offset, and wherein the lower left block is one of the second decoding prediction blocks.

### Claim 6 (depends on 1)

The method of claim 1, wherein after determining the motion information, the method further comprises:
rounding up the motion vector; or
rounding down the motion vector.

### Claim 7 (depends on 1)

The method of claim 1, wherein after performing the motion search to obtain the second decoding prediction blocks, the method further comprises:
rounding up prediction motion vectors corresponding to the second decoding prediction blocks; or
rounding down the prediction motion vectors.

### Claim 8

An apparatus comprising:
a memory configured to store instructions; and
a processor coupled to the memory, wherein the instructions cause the processor to be configured to:
determine motion information of a to-be-decoded block, wherein the motion information comprises a prediction motion vector and reference picture information, and wherein the reference picture information identifies a prediction reference picture block;
obtain a first decoding prediction block of the to-be-decoded block based on the motion information;
perform a motion search with first precision in the prediction reference picture block to obtain second decoding prediction blocks, wherein a search position of the motion search is based on the prediction motion vector and the first precision;
perform downsampling on the first decoding prediction block to obtain a first sampling pixel array;
perform downsampling on the second decoding prediction blocks to obtain second sampling pixel arrays;
calculate a first difference between the first sampling pixel array and each of the second sampling pixel arrays;
set, as a target prediction motion vector of the to-be-decoded block, a motion vector between the to-be-decoded block and a second decoding prediction block of the second decoding prediction blocks, wherein the second decoding prediction block corresponds to a second sampling pixel array of the second sampling pixel arrays that is with a minimum difference of first differences;
obtain a target decoding prediction block of the to-be-decoded block based on the target prediction motion vector; and
decode the to-be-decoded block based on the target decoding prediction block.

### Claim 9 (depends on 8)

The apparatus according of claim 8, wherein the instructions cause the processor to be configured to:
calculate a sum of absolute values of pixel differences of pixels at corresponding locations in the first sampling pixel array and each of the second sampling pixel arrays; and
set the sum as the first difference.

### Claim 10 (depends on 8)

The apparatus of claim 8, wherein the instructions cause the processor to be configured to:
calculate a sum of squares of pixel differences of pixels at corresponding locations in the first sampling pixel array and each of the second sampling pixel arrays; and
set the sum as the first difference.

### Claim 11 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise a base block, an upper block, and a lower block, wherein the instructions further cause the processor to be configured to exclude the lower block from the second decoding prediction blocks when a second difference corresponding to the upper block is less than a third difference corresponding to the base block.

### Claim 12 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise a base block, an upper block, and a lower block, and wherein the instructions further cause the processor to be configured to exclude the upper block from the second decoding prediction blocks when a second difference corresponding to the lower block is less than a third difference corresponding to the base block.

### Claim 13 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise a base block, a left block, and a right block, and wherein the instructions further cause the processor to be configured to:
exclude the right block from the second decoding prediction blocks when a second difference corresponding to the left block is less than a third difference corresponding to the base block; and
exclude the left block from the second decoding prediction blocks when a fourth difference corresponding to the right block is less than the third difference.

### Claim 14 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise an upper block, a lower block, a left block, and a right block, wherein the instructions further cause the processor to be configured to obtain an upper left block in the prediction reference picture block based on a first prediction vector when a second difference corresponding to the upper block is less than a third difference corresponding to the lower block and when a fourth difference corresponding to the left block is less than a fifth difference corresponding to the right block, wherein a first position indicated by the first prediction vector is based on shifting a second position indicated by the prediction motion vector leftward by a target offset and upward by the target offset, wherein the upper left block is one of the second decoding prediction blocks, and wherein the target offset is based on the first precision.

### Claim 15 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise an upper block, a lower block, a left block, and a right block, wherein the instrustions further cause the processor to be configured to obtain an upper right block in the prediction reference picture block based on a first prediction vector when a second difference corresponding to the upper block is less than a third difference corresponding to the lower block and a fourth difference corresponding to the right block is less than a fifth difference corresponding to the left block, wherein a first position indicated by the first prediction vector is based on shifting a second position indicated by the prediction motion vector rightward by a target offset and upward by the target offset, wherein the upper right block is one of the second decoding prediction blocks, and wherein the target offset is based on the first precision.

### Claim 16 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise an upper block, a lower block, a left block, and a right block, wherein the instructions further cause the processor to be configured to obtain a lower right block in the prediction reference picture block based on a first prediction vector when a second difference corresponding to the lower block is less than a third difference corresponding to the upper block and when a fourth difference corresponding to the right block is less than a fifth difference corresponding to the left block, wherein a first position indicated by the first prediction vector is based on shifting a second position indicated by the prediction motion vector rightward by a target offset and downward by the target offset, wherein the lower right block is one of the second decoding prediction blocks, and wherein the target offset is based on the first precision.

### Claim 17 (depends on 8)

The apparatus of claim 8, wherein the second decoding prediction blocks comprise an upper block, a lower block, a left block, and a right block, wherein the instructions further cause the processor to be configured to obtain a lower left block in the prediction reference picture block based on a first prediction vector when a second difference corresponding to the lower block is less than third difference corresponding to the upper block and when a fourth difference corresponding to the left block is less than a fifth difference corresponding to the right block, wherein a first position indicated by the eighth prediction vector is based on shifting a second position indicated by the prediction motion vector leftward by a target offset and downward by the target offset, wherein the lower left block is one of the second decoding prediction blocks, and wherein the target offset is based on the first precision.

### Claim 18 (depends on 8)

The apparatus of claim 8, wherein the instructions further cause the processor to be configured to:
round up the motion vectors; and
round down the motion vector.

### Claim 19 (depends on 8)

The apparatus of claim 8, wherein the instructions further cause the processor to be configured to
round up prediction motion vectors corresponding to the second decoding prediction blocks; and
round down the prediction motion vectors.

### Claim 20

A computer program product comprising computer-executable instructions stored on a non-transitory computer-readable medium that, when executed by a processor, cause an apparatus to:
determine motion information of a to-be-decoded block, wherein the motion information comprises a prediction motion vector and reference picture information, and wherein the reference picture information identifies a prediction reference picture block;
obtain a first decoding prediction block of the to-be-decoded block based on the motion information;
perform a motion search with a first precision in the prediction reference picture block to obtain second decoding prediction blocks, wherein a search position of the motion search is based on the prediction motion vector and the first precision;
perform downsampling on the first decoding prediction block to obtain a first sampling pixel array;
perform downsampling on the second decoding prediction blocks to obtain second sampling pixel arrays;
calculate a difference between the first sampling pixel array and each of the second sampling pixel arrays;
set, as a target prediction motion vector of the to-be-decoded block, a motion vector between the to-be-decoded block and a second decoding prediction block of the second decoding prediction blocks, wherein the second decoding prediction block corresponds to a second sampling pixel array of the second sampling pixel arrays that is with a minimum difference of differences;
obtain a target decoding prediction block of the to-be-decoded block based on the target prediction motion vector; and
decode the to-be-decoded block based on the target decoding prediction block.
