# US 12,114,005 B2 · Encoding and decoding method and apparatus, and devices

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

- Number: US 12,114,005 B2
- Document ID: US12114005B2
- Status: Granted
- Kind: B2
- Application number: 17/766,210
- Filed: 2020-10-28
- Published: 2024-02-29
- Granted: 2024-10-08
- Earliest claimed: 2019-11-05
- Assignees: Hangzhou Hikvision Digital Technology Co., Ltd.
- Applicants: Hangzhou Hikvision Digital Technology Co., Ltd.
- Inventors: Fangdong Chen
- Web page: https://patentgrep.com/patent/US12114005B2

## CPC

- H04N 19/513: Processing of motion vectors
- 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/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/52: by predictive encoding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present disclosure provides an encoding and decoding method, apparatus, and devices. The encoding and decoding method includes the following steps: determining to use a decoder-side motion vector refinement mode for a current block if the conditions are all satisfied; and if it is determined to use the decoder-side motion vector refinement mode for the current block, performing motion compensation on the current block.

## Claims

### Claim 1

A decoding method, comprising:
in response to determining to use decoder-side motion vector refinement mode for a current block, performing, based on the decoder-side motion vector refinement mode, motion compensation on the current block to obtain prediction values of the current block;
wherein, performing, based on the decoder-side motion vector refinement mode, the motion compensation on the current block to obtain the prediction values of the current block, comprising:
for each sub-block of one or more sub-blocks comprised in the current block:
determining, according to a first original motion vector of the sub-block, a first reference block corresponding to the sub-block;
determining, according to a second original motion vector of the sub-block, a second reference block corresponding to the sub-block;
adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; and
determining, according to the first target motion vector and the second target motion vector, prediction values of the sub-block;
obtaining, according to prediction values of all sub-blocks in the current block, prediction values of the current block;
wherein, adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector comprising:
selecting all of (2*SR+1)*(2*SR+1) motion vectors surrounding and comprising an initial motion vector as candidate motion vectors;
according to the first pixel values of the first reference block and the second pixel values of the second reference block, determining cost values of the candidate motion vectors and determining a motion vector with a minimum cost value from the candidate motion vectors as an optimal motion vector;
adjusting, according to the optimal motion vector, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector;
wherein, the initial motion vector is the first original motion vector or the second original motion vector;
wherein, SR represents a search range, a value of SR is equal to 2, and the search order of 25 motion vectors is as follows: {Mv(0, 0), Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)}; Mv(0,0) represents the initial motion vector, other candidates motion vector excluded Mv(0,0) are offset motion vectors of the initial motion vector.

### Claim 2 (depends on 1)

The method of claim 1, wherein after determining the cost value of Mv(0,0), the method further comprising:
in response to determining that the cost value of Mv(0,0) is less than dx*dy, terminating the searching process of cost values of motion vectors after than Mv(0,0), which are {Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)};
wherein, dx represents width of the sub-block and dy represents height of the sub-block.

### Claim 3 (depends on 1)

The method of claim 1, wherein determining, according to the first original motion vector of the sub-block, the first reference block corresponding to the sub-block, and determining, according to the second original motion vector of the sub-block, the second reference block corresponding to the sub-block comprises:
determining the first reference block corresponding to the sub-block from a first reference picture based on the first original motion vector of the sub-block; wherein pixel values of pixel points in the first reference block are obtained by interpolating between pixel values of neighboring pixel points in the first reference block, or by copying the pixel values of the neighboring pixel points in the first reference block; and
determining the second reference block corresponding to the sub-block from a second reference picture based on the second original motion vector of the sub-block; wherein pixel values of pixel points in the second reference block are obtained by interpolating between pixel values of neighboring pixel points in the second reference block, or by copying the pixel values of the neighboring pixel points in the second reference block.

### Claim 4 (depends on 1)

The method of claim 1, furthering comprising:
in response to that following conditions are satisfied, determining to use the decoder-side motion vector refinement mode for the current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use a combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
in response to that any one of following conditions is not satisfied, determining not to use the decoder-side motion vector refinement mode for the current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 6

An encoding method, comprising:
in response to determining to use decoder-side motion vector refinement mode for a current block, encoding the current block based on the decoder-side motion vector refinement mode;
wherein, encoding the current block based on the decoder-side motion vector refinement mode, comprising:
for each sub-block of one or more sub-blocks comprised in the current block:
determining, according to a first original motion vector of the sub-block, a first reference block corresponding to the sub-block;
determining, according to a second original motion vector of the sub-block, a second reference block corresponding to the sub-block;
adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; and
determining, according to the first target motion vector and the second target motion vector, prediction values of the sub-block;
obtaining, according to prediction values of all sub-blocks in the current block, prediction values of the current block;
wherein, adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector comprising:
selecting all of (2*SR+1)*(2*SR+1) motion vectors surrounding and comprising an initial motion vector as candidate motion vectors;
according to the first pixel values of the first reference block and the second pixel values of the second reference block, determining cost values of the candidate motion vectors and determining a motion vector with a minimum cost value from the candidate motion vectors as an optimal motion vector;
adjusting, according to the optimal motion vector, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector;
wherein, the initial motion vector is the first original motion vector or the second original motion vector;
wherein, SR represents a search range, a value of SR is equal to 2, and the search order of 25 motion vectors is as follows: {Mv(0, 0), Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)}; Mv(0,0) represents the initial motion vector, other candidates motion vector excluded Mv(0,0) are offset motion vectors of the initial motion vector.

### Claim 7 (depends on 6)

The method of claim 6, wherein after determining the cost value of Mv (0,0), the method further comprising:
in response to determining that the cost value of Mv(0,0) is less than dx*dy, terminating the searching process of cost values of motion vectors after than Mv(0,0), which are {Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)};
wherein, dx represents width of the sub-block and dy represents height of the sub-block.

### Claim 8 (depends on 6)

The method of claim 6, wherein determining, according to the first original motion vector of the sub-block, the first reference block corresponding to the sub-block, and determining, according to the second original motion vector of the sub-block, the second reference block corresponding to the sub-block comprises:
determining the first reference block corresponding to the sub-block from a first reference picture based on the first original motion vector of the sub-block; wherein pixel values of pixel points in the first reference block are obtained by interpolating between pixel values of neighboring pixel points in the first reference block, or by copying the pixel values of the neighboring pixel points in the first reference block; and
determining the second reference block corresponding to the sub-block from a second reference picture based on the second original motion vector of the sub-block; wherein pixel values of pixel points in the second reference block are obtained by interpolating between pixel values of neighboring pixel points in the second reference block, or by copying the pixel values of the neighboring pixel points in the second reference block.

### Claim 9 (depends on 6)

The method of claim 6, furthering comprising:
in response to that following conditions are satisfied, determining to use the decoder-side motion vector refinement mode for current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 10 (depends on 6)

The method of claim 6, further comprising:
in response to that any one of following conditions is not satisfied, determining not to use the decoder-side motion vector refinement mode for the current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises:
picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 11

A decoding device, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor; and
the processor is configured to execute the machine-executable instructions to implement the operations comprising:
in response to determining to use decoder-side motion vector refinement mode for a current block, performing, based on the decoder-side motion vector refinement mode, motion compensation on the current block to obtain prediction values of the current block;
wherein, performing, based on the decoder-side motion vector refinement mode, the motion compensation on the current block to obtain the prediction values of the current block, comprising:
for each sub-block of one or more sub-blocks comprised in the current block:
determining, according to a first original motion vector of the sub-block, a first reference block corresponding to the sub-block;
determining, according to a second original motion vector of the sub-block, a second reference block corresponding to the sub-block;
adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; and
determining, according to the first target motion vector and the second target motion vector, prediction values of the sub-block;
obtaining, according to prediction values of all sub-blocks in the current block, prediction values of the current block;
wherein, adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector comprising:
selecting all of (2*SR+1)*(2*SR+1) motion vectors surrounding and comprising an initial motion vector as candidate motion vectors;
according to the first pixel values of the first reference block and the second pixel values of the second reference block, determining cost values of the candidate motion vectors and determining a motion vector with a minimum cost value from the candidate motion vectors as an optimal motion vector;
adjusting, according to the optimal motion vector, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector;
wherein, the initial motion vector is the first original motion vector or the second original motion vector;
wherein, SR represents a search range, a value of SR is equal to 2, and the search order of 25 motion vectors is as follows: {Mv(0, 0), Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)}; Mv(0,0) represents the initial motion vector, other candidates motion vector excluded Mv(0,0) are offset motion vectors of the initial motion vector.

### Claim 12 (depends on 11)

The device of claim 11, wherein after determining the cost value of Mv (0,0), the operations further comprising:
in response to determining that the cost value of Mv(0,0) is less than dx*dy, terminating the searching process of cost values of motion vectors after than Mv(0,0), which are {Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)};
wherein, dx represents width of the sub-block and dy represents height of the sub-block.

### Claim 13 (depends on 11)

The device of claim 11, wherein determining, according to the first original motion vector of the sub-block, the first reference block corresponding to the sub-block, and determining, according to the second original motion vector of the sub-block, the second reference block corresponding to the sub-block comprises:
determining the first reference block corresponding to the sub-block from a first reference picture based on the first original motion vector of the sub-block; wherein pixel values of pixel points in the first reference block are obtained by interpolating between pixel values of neighboring pixel points in the first reference block, or by copying the pixel values of the neighboring pixel points in the first reference block; and
determining the second reference block corresponding to the sub-block from a second reference picture based on the second original motion vector of the sub-block; wherein pixel values of pixel points in the second reference block are obtained by interpolating between pixel values of neighboring pixel points in the second reference block, or by copying the pixel values of the neighboring pixel points in the second reference block.

### Claim 14 (depends on 11)

The device of claim 11, the operations furthering comprising:
in response to that following conditions are satisfied, determining to use the decoder-side motion vector refinement mode for current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 15 (depends on 11)

The device of claim 11, the operations further comprising:
in response to that any one of following conditions is not satisfied, determining not to use the decoder-side motion vector refinement mode for the current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 16

An encoding device, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor; and
the processor is configured to execute the machine-executable instructions to implement the operations comprising:
in response to determining to use decoder-side motion vector refinement mode for a current block, encoding the current block based on the decoder-side motion vector refinement mode;
wherein, encoding the current block based on the decoder-side motion vector refinement mode, comprising:
for each sub-block of one or more sub-blocks comprised in the current block:
determining, according to a first original motion vector of the sub-block, a first reference block corresponding to the sub-block;
determining, according to a second original motion vector of the sub-block, a second reference block corresponding to the sub-block;
adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; and
determining, according to the first target motion vector and the second target motion vector, prediction values of the sub-block;
obtaining, according to prediction values of all sub-blocks in the current block, prediction values of the current block;
wherein, adjusting, according to first pixel values of the first reference block and second pixel values of the second reference block, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector comprising:
selecting all of (2*SR+1)*(2*SR+1) motion vectors surrounding and comprising an initial motion vector as candidate motion vectors;
according to the first pixel values of the first reference block and the second pixel values of the second reference block, determining cost values of the candidate motion vectors and determining a motion vector with a minimum cost value from the candidate motion vectors as an optimal motion vector;
adjusting, according to the optimal motion vector, the first original motion vector and the second original motion vector, to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector;
wherein, the initial motion vector is the first original motion vector or the second original motion vector;
wherein, SR represents a search range, a value of SR is equal to 2, and the search order of 25 motion vectors is as follows: {Mv(0, 0), Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)}; Mv(0,0) represents the initial motion vector, other candidates motion vector excluded Mv(0,0) are offset motion vectors of the initial motion vector.

### Claim 17 (depends on 16)

The device of claim 16, wherein after determining the cost value of Mv (0,0), the operations further comprising:
in response to determining that the cost value of Mv(0,0) is less than dx*dy, terminating the searching process of cost values of motion vectors after than Mv(0,0), which are {Mv(−2, −2), Mv(−1, −2), Mv(0, −2), Mv(1, −2), Mv(2, −2), Mv(−2, −1), Mv(−1, −1), Mv(0, −1), Mv(1, −1), Mv(2, −1), Mv(−2, 0), Mv(−1, 0), Mv(0, 0), Mv(1, 0), Mv(2, 0), Mv(−2, 1), Mv(−1, 1), Mv(0, 1), Mv(1, 1), Mv(2, 1), Mv(−2, 2), Mv(−1, 2), Mv(0, 2), Mv(1, 2), Mv(2, 2)};
wherein, dx represents width of the sub-block and dy represents height of the sub-block.

### Claim 18 (depends on 16)

The device of claim 16, wherein determining, according to the first original motion vector of the sub-block, the first reference block corresponding to the sub-block, and determining, according to the second original motion vector of the sub-block, the second reference block corresponding to the sub-block comprises:
determining the first reference block corresponding to the sub-block from a first reference picture based on the first original motion vector of the sub-block; wherein pixel values of pixel points in the first reference block are obtained by interpolating between pixel values of neighboring pixel points in the first reference block, or by copying the pixel values of the neighboring pixel points in the first reference block; and
determining the second reference block corresponding to the sub-block from a second reference picture based on the second original motion vector of the sub-block; wherein pixel values of pixel points in the second reference block are obtained by interpolating between pixel values of neighboring pixel points in the second reference block, or by copying the pixel values of the neighboring pixel points in the second reference block.

### Claim 19 (depends on 16)

The device of claim 16, the operations furthering comprising:
in response to that following conditions are satisfied, determining to use the decoder-side motion vector refinement mode for current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.

### Claim 20 (depends on 16)

The device of claim 16, the operations further comprising:
in response to that any one of following conditions is not satisfied, determining not to use the decoder-side motion vector refinement mode for the current block;
wherein the conditions comprise:
picture-level control information is configured to indicate the current block to enable the decoder-side motion vector refinement mode;
the current block uses a regular merge mode;
the current block doesn't use combine inter intra prediction (CIIP) mode or a merge with motion vector difference (MMVD) mode;
the current block uses a bidirectional prediction mode;
wherein, prediction values of the current block are obtained by use of a weighted sample prediction process on reference blocks of two reference pictures, and the two reference pictures of the current block are same in weight; directions of the two reference pictures are different, one reference picture is displayed earlier than a current picture, the other picture is displayed later than the current picture, and the two reference pictures have a same distance from the current picture;
wherein, two reference pictures of the current block being same in weight comprises: picture-level weights of the two reference pictures are same and block-level weights of the two reference pictures are same;
the two reference pictures of the current block both are short-term reference pictures;
the two reference pictures of the current block are identical in size to the current picture;
the size of the current block is satisfied: the width is greater than or equal to 8, the height is greater than or equal to 8, and the area is greater than or equal to 128.
