# US 2023/0403408 A1 · Bit-width control for bi-directional optical flow

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

- Number: US 2023/0403408 A1
- Document ID: US20230403408A1
- Status: Published application
- Kind: A1
- Application number: 18/239,122
- Filed: 2023-08-28
- Published: 2023-12-14
- Earliest claimed: 2019-01-06
- Assignees: Beijing Dajia Internet Information Technology Co., Ltd.
- Applicants: Beijing Dajia Internet Information Technology Co., Ltd.
- Inventors: Xiaoyu XIU; Yi-Wen CHEN; Xianglin WANG
- Web page: https://patentgrep.com/patent/US20230403408A1

## 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/577: Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
- H04N 19/103: Selection of coding mode or of prediction mode
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/513: Processing of motion vectors
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method for controlling bit-width for bi-directional optical flow (BDOF) for video coding includes encoding a first reference picture and a second reference picture, the second reference picture being different than the first reference picture, wherein the first reference picture is displayed before a current picture and the second reference picture is displayed after the current picture. A motion refinement of a coding unit (CU) is calculated by minimizing a difference between a first prediction L0 and a second prediction L1. First gradient values for the first prediction L0 and second gradient values for the second prediction L1 are calculated. A final bi-prediction of the CU is calculated. Also disclosed are an associated apparatus and an associated non-transitory computer readable storage medium.

## Claims

### Claim 1

A method for video encoding, comprising:
obtaining a current block from a current picture;
determining, for the current block, a first prediction corresponding to a first reference picture, wherein the first reference picture is displayed before the current picture;
determining, for the current block, a second prediction corresponding to a second reference picture, wherein the second reference picture is displayed after the current picture;
calculating first gradient values for the first prediction and second gradient values for the second prediction;
calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction based on a motion refinement threshold and a plurality of internal parameters representing different summation characters of the first prediction and the second prediction;
calculating a final bi-prediction of the current block based on the first prediction, the second prediction, respective motion refinements, the first gradient values and the second gradient values; and
generating a video bitstream based on the final bi-prediction.

### Claim 2 (depends on 1)

The method of claim 1, wherein calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction comprises:
calculating a horizontal summation by adding a first horizontal gradient and a second horizontal gradient, and calculating a vertical summation by adding a first vertical gradient and a second vertical gradient, wherein a first right shift value is introduced into the horizontal summation and the vertical summation for lowering a bit-width of each of the horizontal summation and the vertical summation; and
calculating a respective motion refinement of each subblock of the current block based on the horizontal summation and the vertical summation.

### Claim 3 (depends on 1)

The method of claim 1, wherein a second right shift value is introduced into the calculation of the first gradient values for the first prediction and the calculation of the second gradient values for the second prediction.

### Claim 4 (depends on 1)

The method of claim 1, wherein calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction comprises: clipping a horizontal motion refinement and a vertical motion refinement in the respective motion refinement to a range of [−thBDOF, thBDOF], wherein thBDOF is a motion refinement threshold, and wherein the respective motion refinement comprises the horizontal motion refinement and the vertical motion refinement.

### Claim 5 (depends on 1)

The method of claim 1, wherein a third right shift value is introduced into the calculation of the difference between the first prediction and the second prediction.

### Claim 6 (depends on 1)

The method of claim 1, wherein calculating the first gradient values for the first prediction and the second gradient values for the second prediction further comprises calculating a horizontal gradient and a vertical gradient at each of a first prediction position of the first prediction and a second prediction position of the second prediction.

### Claim 7 (depends on 1)

The method of claim 1, wherein calculating the final bi-prediction of the current block comprises:
calculating the final bi-prediction of the current block based further on a fourth right shift value for combining the first prediction and the second prediction.

### Claim 8 (depends on 7)

The method of claim 7, wherein the fourth right shift value comprises an additional right shift value, and wherein the additional right shift value is set to be equal to a bit-depth of a video for decoding.

### Claim 9 (depends on 1)

The method of claim 1, wherein the first prediction is determined based on a first motion vector from the current block to the first reference picture, and wherein the second prediction is determined based on a second motion vector from the current block to the second reference picture.

### Claim 10

A computing device, comprising:
one or more processors;
a non-transitory storage coupled to the one or more processors; and
a plurality of programs stored in the non-transitory storage that, when executed by the one or more processors individually or collectively, cause the computing device to perform acts comprising:
obtaining a current block from a current picture;
determining, for the current block of, a first prediction corresponding to a first reference picture, wherein the first reference picture is displayed before the current picture;
determining, for the current block, a second prediction corresponding to a second reference picture, wherein the second reference picture is displayed after the current picture;
calculating first gradient values for the first prediction and second gradient values for the second prediction;
calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction based on a motion refinement threshold and a plurality of internal parameters representing different summation characters of the first prediction and the second prediction;
calculating a final bi-prediction of the current block based on the first prediction, the second prediction, respective motion refinements, the first gradient values, and the second gradient values; and
generating a video bitstream based on the final bi-prediction.

### Claim 11 (depends on 10)

The computing device of claim 10, calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction comprises:
calculating a horizontal summation by adding a first horizontal gradient and a second horizontal gradient, and calculating a vertical summation by adding a first vertical gradient and a second vertical gradient, wherein a first right shift value is introduced into the horizontal summation and the vertical summation for lowering a bit-width of each of the horizontal summation and the vertical summation; and
calculating a respective motion refinement of each subblock of the current block based on the horizontal summation and the vertical summation.

### Claim 12 (depends on 10)

The computing device of claim 10, wherein a first right shift value is introduced into the calculation of both the first gradient values for the first prediction and the calculation of the second gradient values for the second prediction.

### Claim 13 (depends on 10)

The computing device of claim 10, wherein calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction comprises: clipping a horizontal motion refinement and a vertical motion refinement in the respective motion refinement to a range of [−thBDOF, thBDOF], wherein thBDOF is a motion refinement threshold, and wherein the respective motion refinement comprises the horizontal motion refinement and the vertical motion refinement.

### Claim 14 (depends on 10)

The computing device of claim 10, wherein a second right shift value is introduced into the calculation of the difference between the first prediction and the second prediction.

### Claim 15 (depends on 10)

The computing device of claim 10, calculating the first gradient values for the first prediction and the second gradient values for the second prediction further comprises calculating a horizontal gradient and a vertical gradient at each of a first prediction position of the first prediction and a second prediction position of the second prediction.

### Claim 16 (depends on 10)

The computing device of claim 10, wherein calculating the final bi-prediction of the current block comprises:
calculating the final bi-prediction of the current block based further on a fourth right shift value for combining the first prediction and the second prediction.

### Claim 17 (depends on 16)

The computing device of claim 16, wherein the fourth right shift value comprises an additional right shift value, and wherein the additional right shift value is set to be equal to a bit-depth of a video for decoding.

### Claim 18 (depends on 10)

The computing device of claim 10, wherein the first prediction is determined based on a first motion vector from the current block to the first reference picture, and wherein the second prediction is determined based on a second motion vector from the current block to the second reference picture.

### Claim 19

A non-transitory computer readable storage medium storing a plurality of programs for execution by a computing device having one or more processors, wherein the plurality of programs, when executed by the one or more processors individually or collectively, cause the computing device to perform acts to generate a video bitstream and store the generated video bitstream in the non-transitory computer readable storage medium, the acts comprising:
obtaining a current block from a current picture;
determining, for the current block of, a first prediction corresponding to a first reference picture, wherein the first reference picture is displayed before the current picture;
determining, for the current block, a second prediction corresponding to a second reference picture, wherein the second reference picture is displayed after the current picture;
calculating first gradient values for the first prediction and second gradient values for the second prediction;
calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction based on a motion refinement threshold and a plurality of internal parameters representing different summation characters of the first prediction and the second prediction;
calculating a final bi-prediction of the current block based on the first prediction, the second prediction, respective motion refinements, the first gradient values and the second gradient values; and
generating a video bitstream based on the final bi-prediction.

### Claim 20 (depends on 19)

The storage medium of claim 19, wherein calculating a respective motion refinement of each subblock of the current block by minimizing a difference between the first prediction and the second prediction comprises:
calculating a horizontal summation by adding the first horizontal gradient and the second horizontal gradient, and calculating a vertical summation by adding the first vertical gradient and the second vertical gradient, wherein a first right shift value is introduced into the horizontal summation and the vertical summation for lowering a bit-width of each of the horizontal summation and the vertical summation; and
calculating a respective motion refinement of each subblock of the current block based on the horizontal summation and the vertical summation.
