# US 2022/0046249 A1 · Methods and apparatuses for prediction refinement with optical flow

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

- Number: US 2022/0046249 A1
- Document ID: US20220046249A1
- Status: Published application
- Kind: A1
- Application number: 17/510,328
- Filed: 2021-10-25
- Published: 2022-02-10
- Earliest claimed: 2019-04-25
- Assignees: Beijing Dajia Internet Information Technology Co., Ltd.
- Applicants: Beijing Dajia Internet Information Technology Co., Ltd.
- Inventors: Xiaoyu XIU; Yi-Wen CHEN; Xianglin WANG; Shuiming YE; Tsung-Chuan MA; Hong-Jheng JHU
- Web page: https://patentgrep.com/patent/US20220046249A1

## CPC

- H04N 19/137: Motion inside a coding unit, e.g. average field, frame or block difference
- 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/132: Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/54: using feature points or meshes
- H04N 19/563: Motion estimation with padding, i.e. with filling of non-object values in an arbitrarily shaped picture block or region for estimation purposes
- H04N 19/577: Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Methods, apparatuses, and non-transitory computer-readable storage mediums are provided for prediction refinement with optical flow (PROF) for decoding a video signal. A decoder may obtain a first reference picture associated with a video block in a current picture within the video signal and a first motion vector (MV) from the video block in the current picture to a reference video block in the first reference picture. The decoder may obtain first prediction samples I(i, j) of a video block generated from the reference video block in the first reference picture. The decoder may control internal bit-depths of internal PROF parameters. The decoder may obtain prediction refinement values for the first prediction samples I(i, j) based on the horizontal and vertical gradient values and the horizontal and vertical motion differences. The decoder may obtain second prediction samples I′(i, j). The decoder may obtain final prediction samples of the video block.

## Claims

### Claim 1

A method of prediction refinement with optical flow (PROF) for decoding a video signal, comprising:
obtaining a first reference picture associated with a video block in a current picture within the video signal and a first motion vector (MV) from the video block in the current picture to a reference video block in the first reference picture, wherein the first reference picture comprises multiple non-overlapped video blocks and at least one video block is associated with at least one MV;
obtaining first prediction samples I(i, j) of a video block generated from the reference video block in the first reference picture, wherein i and j represent a coordinate of one sample within the video block;
controlling internal bit-depths of internal PROF parameters, wherein the internal PROF parameters comprise horizontal gradient values, vertical gradient values, horizontal motion differences, and vertical motion differences derived for the first prediction samples I(i, j);
obtaining prediction refinement values for the first prediction samples I(i, j) based on the horizontal and vertical gradient values and the horizontal and vertical motion differences;
obtaining, when the video block contains a second MV, second prediction samples I′(i, j) associated with the second MV and corresponding prediction refinement values for the second prediction samples I′(i, j); and
obtaining final prediction samples of the video block based on the first prediction samples I(i, j), the second prediction samples I′(i, j), and the prediction refinement values.

### Claim 2 (depends on 1)

The method of claim 1, wherein controlling the internal bit-depths of the internal PROF parameters comprises:
obtaining a horizontal gradient value based on prediction samples of two samples adjacent to a sample in the video block in a horizontal direction and a first shift value; and
obtaining a vertical gradient value based on prediction samples of two samples adjacent to the sample in the video block in a vertical direction and the first shift value.

### Claim 3 (depends on 2)

The method of claim 2, wherein the first shift value is equal to a maximum of 6 and a value of coding bit-depth minus 6.

### Claim 4 (depends on 2)

The method of claim 2, further comprising, for said one sample in the video block:
obtaining control point MVs of a coding block, wherein the coding block contains the video block, wherein the control point MVs comprises MVs of top-left, top-right, and bottom-left corner blocks of the coding block;
obtaining affine model parameters derived based on the control point MVs;
obtaining a horizontal MV difference Δνx(i, j) and a vertical MV difference Δνy(i, j) based on the affine parameters, the horizontal offset, and the vertical offset;
right shifting the horizontal MV difference Δνx(i, j) by a second shift value; and
right shifting the vertical MV difference Δνy(i, j) by the second shift value.

### Claim 5 (depends on 4)

The method of claim 4, wherein the second shift value is equal to 13 minus a precision bit-depth of gradient values.

### Claim 6 (depends on 5)

The method of claim 5, wherein the precision bit-depth of gradient values is equal to a maximum of 6 and a value of coding bit-depth minus 6.

### Claim 7 (depends on 4)

The method of claim 4, wherein when the video block contains the second MV, obtaining the final prediction samples of the video block comprises:
obtaining first prediction refinement values ΔI(i, j) based on the horizontal gradient values, the horizontal MV differences Δνx(i, j), the vertical gradient values, and the vertical MV differences Δνy(i, j) that are generated for the first prediction samples I(i, j);
obtaining second prediction refinement values ΔI′(i, j) based on the horizontal gradient values, the horizontal motion differences Δνx(i, j), the vertical gradient values, and the vertical motion differences Δνy(i, j) that are generated for the second prediction samples I′(i, j);
obtaining the prediction refinement values by averaging the first prediction refinement values ΔI(i, j) and the second prediction refinement values ΔI′(i, j);
obtaining the bi-prediction samples based on a sum of the first prediction samples I(i, j), the second prediction samples I′(i, j), the prediction refinement values; and
right shifting the sum by a third shift value.

### Claim 8 (depends on 2)

The method of claim 2, wherein obtaining the horizontal and vertical gradient values of the first prediction sample I(i, j) further comprises:
deriving an additional row or column of prediction samples outside the video block, wherein the additional row or column is adjacent to each of top, left, bottom and right boundaries of the video block for the first prediction samples I(i, j).

### Claim 9 (depends on 8)

The method of claim 8, wherein deriving the additional row or column of the prediction samples further comprises:
deriving prediction samples outside the video block, wherein the prediction samples are adjacent to the left and right boundaries from integer reference samples in the first reference picture left to a fractional sample position; and
deriving prediction samples outside the video block, wherein the prediction samples are adjacent to the top and bottom boundaries from integer reference samples in the first reference picture above the fractional sample position.

### Claim 10 (depends on 8)

The method of claim 8, wherein deriving the additional row or column of the prediction samples further comprises:
deriving prediction samples outside the video block, wherein the prediction samples are adjacent to the left and right boundaries from integer reference samples in the first reference picture that are closest to respective fractional sample positions in a horizontal direction; and
deriving prediction samples outside the video block, wherein the prediction samples are adjacent to the top and bottom boundaries from integer reference samples in the first reference picture that are closest to the respective fractional sample positions in a vertical direction.

### Claim 11

A computing device comprising:
one or more processors;
a non-transitory computer-readable storage medium storing instructions executable by the one or more processors, wherein the one or more processors are configured to:
obtain a first reference picture associated with a video block in a current picture within the video signal and a first motion vector (MV) from the video block in the current picture to a reference video block in the first reference picture, wherein the first reference picture comprises multiple non-overlapped video blocks and at least one video block is associated with at least one MV;
obtain first prediction samples I(i, j) of a video block generated from the reference video block in the first reference picture, wherein i and j represent a coordinate of one sample within the video block;
control internal bit-depths of internal PROF parameters, wherein the internal PROF parameters comprise horizontal gradient values, vertical gradient values, horizontal motion differences, and vertical motion differences derived for the first prediction samples I(i, j);
obtain prediction refinement values for the first prediction samples I(i, j) based on the horizontal and vertical gradient values and the horizontal and vertical motion differences;
obtain, when the video block contains a second MV, second prediction samples I′(i, j) associated with the second MV and corresponding prediction refinement values for the second prediction samples I′(i, j); and
obtain final prediction samples of the video block based on the first prediction samples I(i, j), the second prediction samples I′(i, j), and the prediction refinement values.

### Claim 12 (depends on 11)

The computing device of claim 11, wherein the one or more processors configured to control the internal bit-depths of the internal PROF parameters are further configured to:
obtain a horizontal gradient value based on prediction samples of two samples adjacent to a sample in the video block in a horizontal direction and a first shift value; and
obtain a vertical gradient value based on prediction samples of two samples adjacent to the sample in the video block in a vertical direction and the first shift value.

### Claim 13 (depends on 12)

The computing device of claim 12, wherein the first shift value is equal to a maximum of 6 and a value of coding bit-depth minus 6.

### Claim 14 (depends on 12)

The computing device of claim 12, wherein the one or more processors are further configured to, for said one sample in the video block:
obtain control point MVs of a coding block, wherein the coding block contains the video block, wherein the control point MVs comprises MVs of top-left, top-right, and bottom-left corner blocks of the coding block;
obtain affine model parameters derived based on the control point MVs;
obtain a horizontal MV difference Δνx(i, j) and a vertical MV difference Δνy(i, j) based on the affine parameters, the horizontal offset, and the vertical offset;
right shift the horizontal MV difference Δνx(i, j) by a second shift value; and
right shift the vertical MV difference Δνy(i ,j) by the second shift value.

### Claim 15 (depends on 14)

The computing device of claim 14, wherein the second shift value is equal to 13 minus a precision bit-depth of gradient values.

### Claim 16 (depends on 15)

The computing device of claim 15, wherein the precision bit-depth of gradient values is equal to a maximum of 6 and a value of coding bit-depth minus 6.

### Claim 17 (depends on 14)

The computing device of claim 14, wherein the one or more processors configured to obtain, when the video block contains the second MV, the final prediction samples of the video block are further configured to:
obtain first prediction refinement values ΔI(i, j) based on the horizontal gradient values, the horizontal MV differences Δνx(i, j), the vertical gradient values, and the vertical MV differences Δνy(i, j) that are generated for the first prediction samples I(i, j);
obtain second prediction refinement values ΔI′(i, j) based on the horizontal gradient values, the horizontal motion differences Δνx(i, j), the vertical gradient values, and the vertical motion differences Δνy(i, j) that are generated for the second prediction samples I′(i, j);
obtain the prediction refinement values by averaging the first prediction refinement values ΔI(i, j) and the second prediction refinement values ΔI′(i, j);
obtain the bi-prediction samples based on a sum of the first prediction samples I(i, j), the second prediction samples I′(i, j), the prediction refinement values; and
right shift the sum by a third shift value.

### Claim 18 (depends on 12)

The computing device of claim 12, wherein the one or more processors configured to obtain the horizontal and vertical gradient values of the first prediction sample I(i, j) are further configured to:
derive an additional row or column of prediction samples outside the video block, wherein the additional row or column is adjacent to each of top, left, bottom and right boundaries of the video block for the first prediction samples I(i, j).

### Claim 19 (depends on 18)

The computing device of claim 18, wherein the one or more processors configured to derive the additional row or column of the prediction samples are further configured to:
derive prediction samples outside the video block, wherein the prediction samples are adjacent to the left and right boundaries from integer reference samples in the first reference picture left to a fractional sample position; and
derive prediction samples outside the video block, wherein the prediction samples are adjacent to the top and bottom boundaries from integer reference samples in the first reference picture above the fractional sample position.

### Claim 20 (depends on 18)

The computing device of claim 18, wherein the one or more processors configured to derive the additional row or column of the prediction samples are further configured to:
derive prediction samples outside the video block, wherein the prediction samples are adjacent to the left and right boundaries from integer reference samples in the first reference picture that are closest to respective fractional sample positions in a horizontal direction; and
derive prediction samples outside the video block, wherein the prediction samples are adjacent to the top and bottom boundaries from integer reference samples in the first reference picture that are closest to the respective fractional sample positions in a vertical direction.
