IP Library Granted Patent US 12707060
Granted Patent B2
US 12707060 · App. 18/973,619 · Granted Aug 11, 2026

Early termination for optical flow refinement

Inventors: Semih Esenlik (Munich, DE); Sriram Sethuraman (Bangalore, IN); Jeeva Raj A (Rasipuram, IN); Sagar Kotecha (Mangal Karyalaya, IN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
H04N19/132H04N19/117H04N19/159H04N19/176H04N19/82
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12707060
App. No.
18/973,619
Granted
Aug 11, 2026
Kind
B2
Abstract

It is provided a method of video coding implemented in a decoding device or an encoding device, the method comprising: obtaining initial motion vectors for a current block; obtaining first predictions for a sample value in the current block based on the initial motion vectors; calculating a first matching cost according to the first predictions; determining whether an optical flow refinement process should be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the calculated first matching cost is equal to or larger than a threshold value; and performing an optical flow refinement process for obtaining a final inter prediction for the sample value in the current block, when it is determined that the optical flow refinement process should be performed.

Claims (58)

1 . A method of video coding implemented in an encoding device, the method comprising:

obtaining a pair of initial motion vectors for a current block, wherein the current block is a sub-block;

obtaining two first prediction blocks for the current block based on the pair of initial motion vectors;

calculating a first matching cost according to the two first prediction blocks, wherein the first matching cost is a sum of absolute differences (SAD) between the two first prediction blocks;

obtaining a pair of refined motion vectors based on the pair of initial motion vectors;

obtaining two second prediction blocks for the current block according to the pair of refined motion vectors;

obtaining a second matching cost corresponding to the two second prediction blocks;

determining whether an optical flow refinement process is to be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the second matching cost is less than a threshold;

performing an optical flow refinement process on the two second prediction blocks for obtaining a final prediction block for the current block, when it is determined that the optical flow refinement process is to be performed;

obtaining the final prediction block by a weighted sum of the two second prediction blocks when it is determined that the optical flow refinement process is not to be performed;

obtaining a residual block based on the current block and the final prediction block; and

encoding the residual block into a bitstream.

2 . The method of claim 1 , further comprising:

determining whether the current block is eligible to perform motion vector refinement (MVR);

if the current block is determined to be eligible to perform MVR, obtaining the pair of refined motion vectors based on the pair of initial motion vectors.

3 . The method of claim 1 , wherein the at least one preset condition further comprises the condition that whether the current block is allowed to be predicted by decoder-side motion vector refinement.

4 . The method of claim 1 , wherein it is determined that the optical flow refinement process is not to be performed, when it is determined that the second matching cost is less than a threshold and the current block is allowed to be predicted by decoder-side motion vector refinement.

5 . The method of claim 1 , wherein it is determined that the optical flow refinement process is to be performed, when it is determined that the second matching cost is not less than a threshold or the current block is not allowed to be predicted by decoder-side motion vector refinement.

6 . The method of claim 1 , wherein the two first prediction blocks for the current block are obtained based on a bilinear interpolation filter.

7 . The method of claim 1 , wherein the two second prediction blocks for the current block are obtained according to an 8-tap interpolation filter.

8 . The method of claim 1 , wherein a value of the threshold is obtained according to a size of the current block.

9 . An encoder comprising: a memory configured to store instructions; and

a processor coupled to the memory, wherein the instructions when executed cause the processor to be configured for:

obtaining a pair of initial motion vectors for a current block, wherein the current block is a sub-block;

obtaining two first prediction blocks for the current block based on the pair of initial motion vectors;

calculating a first matching cost according to the two first prediction blocks, wherein the first matching cost is a sum of absolute differences (SAD) between the two first prediction blocks;

obtaining a pair of refined motion vectors based on the pair of initial motion vectors;

obtaining two second prediction blocks for the current block according to the pair of refined motion vectors;

obtaining a second matching cost corresponding to the two second prediction blocks;

determining whether an optical flow refinement process is to be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the second matching cost is less than a threshold;

performing an optical flow refinement process on the two second prediction blocks for obtaining a final prediction block for the current block, when it is determined that the optical flow refinement process is to be performed;

obtaining the final prediction block by a weighted sum of the two second prediction blocks when it is determined that the optical flow refinement process is not to be performed;

obtaining a residual block based on the current block and the final prediction block; and

encoding the residual block into a bitstream.

10 . The encoder of claim 9 , further comprising:

determining whether the current block is eligible to perform motion vector refinement (MVR);

if the current block is determined to be eligible to perform MVR, obtaining the pair of refined motion vectors based on the pair of initial motion vectors.

11 . The encoder of claim 9 , wherein the at least one preset condition further comprises the condition that whether the current block is allowed to be predicted by decoder-side motion vector refinement.

12 . The encoder of claim 9 , wherein it is determined that the optical flow refinement process is not to be performed, when it is determined that the second matching cost is less than a threshold and the current block is allowed to be predicted by decoder-side motion vector refinement.

13 . The encoder of claim 9 , wherein it is determined that the optical flow refinement process is to be performed, when it is determined that the second matching cost is not less than a threshold or the current block is not allowed to be predicted by decoder-side motion vector refinement.

14 . The encoder of claim 9 , wherein the two first prediction blocks for the current block are obtained based on a bilinear interpolation filter.

15 . The encoder of claim 9 , wherein the two second prediction blocks for the current block are obtained according to an 8-tap interpolation filter.

16 . The encoder of claim 9 , wherein a value of the threshold is obtained according to a size of the current block.

17 . A non-transitory computer readable storage medium storing instructions, wherein when the instructions are performed by one or more processors, the one or more processors are configured to perform:

obtaining a pair of initial motion vectors for a current block, wherein the current block is a sub-block;

obtaining two first prediction blocks for the current block based on the pair of initial motion vectors;

calculating a first matching cost according to the two first prediction blocks, wherein the first matching cost is a sum of absolute differences (SAD) between the two first prediction blocks;

obtaining a pair of refined motion vectors based on the pair of initial motion vectors;

obtaining two second prediction blocks for the current block according to the pair of refined motion vectors;

obtaining a second matching cost corresponding to the two second prediction blocks;

determining whether an optical flow refinement process is to be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the second matching cost is less than a threshold;

performing an optical flow refinement process on the two second prediction blocks for obtaining a final prediction block for the current block, when it is determined that the optical flow refinement process is to be performed;

obtaining the final prediction block by a weighted sum of the two second prediction blocks when it is determined that the optical flow refinement process is not to be performed;

obtaining a residual block based on the current block and the final prediction block; and

encoding the residual block into the bitstream.

18 . The computer readable storage medium of claim 17 , wherein it is determined that the optical flow refinement process is to be performed, when it is determined that the second matching cost is not less than a threshold or the current block is not allowed to be predicted by decoder-side motion vector refinement.

19 . The computer readable storage medium of claim 17 , wherein the two first prediction blocks for the current block are obtained based on a bilinear interpolation filter.

20 . The computer readable storage medium of claim 17 , wherein the two second prediction blocks for the current block are obtained according to an 8-tap interpolation filter.