بعض محتويات هذا التطبيق غير متوفرة في الوقت الحالي.
إذا استمرت هذه الحالة ، يرجى الاتصال بنا علىتعليق وإتصال
1. (WO2017036399) METHOD AND APPARATUS OF MOTION COMPENSATION FOR VIDEO CODING BASED ON BI PREDICTION OPTICAL FLOW TECHNIQUES
Document

Description

Title of Invention 0001   0002   0003   0004   0005   0006   0007   0008   0009   0010   0011   0012   0013   0014   0015   0016   0017   0018   0019   0020   0021   0022   0023   0024   0025   0026   0027   0028   0029   0030   0031   0032   0033   0034   0035   0036   0037   0038   0039   0040   0041   0042   0043   0044   0045   0046   0047   0048   0049   0050   0051   0052   0053   0054   0055   0056   0057   0058   0059   0060   0061   0062   0063  

Claims

1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20  

Drawings

0001   0002   0003   0004  

Description

Title of Invention : METHOD AND APPARATUS OF MOTION COMPENSATION FOR VIDEO CODING BASED ON BI PREDICTION OPTICAL FLOW TECHNIQUES

[0001]
CROSS REFERENCE TO RELATED APPLICATIONS
[0002]
The present invention claims priority to U.S. Provisional Patent Application, Serial No. 62/213,249, filed on September 2, 2015. The U.S. Provisional Patent Application is hereby incorporated by reference in its entirety.

TECHNICAL FIELD

[0003]
The present invention relates to motion compensation for video coding using bi-directional optical flow (BIO) techniques. In particular, the present invention relates to extending the BIO to more general cases, or applying BIO adaptively to improve performance or reducing complexity.

BACKGROUND

[0004]
Bi-directional optical flow (BIO) is motion estimation/compensation technique disclosed in JCTVC-C204 (E. Alshina, et al., Bi-directional optical flow, Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 3rd Meeting: Guangzhou, CN, 7-15 October, 2010, Document: JCTVC-C204) and VCEG-AZ05 (E. Alshina, et al., Known tools performance investigation for next generation video coding, ITU-T SG 16 Question 6, Video Coding Experts Group (VCEG) , 52 nd Meeting: 19–26 June 2015, Warsaw, Poland, Document: VCEG-AZ05) . BIO derived the sample-level motion refinement based on the assumptions of optical flow and steady motion. It is applied only for truly bi-directional predicted blocks, which is predicted from two reference frames corresponding to the previous frame and the latter frame. In VCEG-AZ05, BIO utilizes a 5x5 window to derive the motion refinement of each sample. Therefore, for an NxN block, the motion compensated results and corresponding gradient information of an (N+4) x (N+4) block are required to derive the sample-based motion refinement for the NxN block. According to VCEG-AZ05, a 6-Tap gradient filter and a 6-Tap interpolation filter are used to generate the gradient information for BIO. Therefore, the computation complexity of BIO is much higher than that of traditional bi-directional prediction. In order to further improve the performance of BIO, the following methods are proposed.
[0005]
In a conventional bi-prediction (bi prediction) in HEVC, the predictor is generated using equation (1) , where P (0) and P (1) are the list0 and list1 predictor, respectively.
[0006]
P Conventional [i, j] = (P (0) [i, j] +P (1) [i, j] +1) >>1 (1)
[0007]
In JCTVC-C204 and VECG-AZ05, the BIO predictor is generated using equation (2) .
[0008]
P OpticalFlow= (P (0) [i, j] +P (1) [i, j] +v x [i, j] (I x (0) -I x (1) [i, j] ) +
[0009]
v y [i, j] (I y (0) -I y (1) [i, j] ) +1) >>1 (2)
[0010]
In equation (2) , I x (0) and I x (1) represent the x-directional gradient in list0 and list1 predictor, respectively; I y (0) and I y (1) represents the y-directional gradient in list0 and list1 predictor, respectively; v x and v y represents the offsets in x-and y-direction, respectively. The above equations are derived using differential techniques to compute velocity from spatiotemporal derivatives of image intensity as shown in eq. (3a) and eq. (3b) , where I (x, y, t) represents image intensity in the spatiotemporal coordinates:
[0011]
I (x, y, t) =I (x+MV0 x+v x, y+MV0 y+v y, t-Δt) (3a)
[0012]
=I(x+MV1 x-v x, y+MV1 y-v y, t+Δt) (3b)
[0013]
Eq. (3a) can be further derived as follows:
[0014]
[Math. 0001]


[0015]
Similarly, eq. (3b) can be further derived as follows:
[0016]
[Math. 0002]


[0017]
[Math. 0003]


[0018]
Accordingly, the bi-directional optical flow is derived as follows, which is equivalent to eq. (2) with
[0019]
[Math. 0004]


[0020]
The difference Δ [i, j] between values in two points can be derived according to:
[0021]
[Math. 0005]


[0022]
The difference Δ [i, j] between values in two points is referred as flow difference at two points in this disclosure. In eq. (6) , v x [i, j] and v y [i, j] are pixel-wise motion vector refinement components, where only fine motion is considered and the major motion is compensated by MC. Also and are gradients of luminance I in the position [i , j] of list0 and list1 reference frames correspondently. The motion vector refinement components, v x [i, j] and v y [i, j] are also referred as the x-offset value and the y-offset value in this disclosure.
[0023]
In order to solve v x [i, j] and v y [i, j] , a window consisting the pixel being processed and (2M+1) × (2M+1) neighbours is used. The pixel set Ω represents pixels in the window, i.e., [i', j’ ] ∈ Ω if and only if i-M ≤ i'≤ i+M and j-M ≤ j’ ≤ j+M. The v x[i, j] and v y [i, j] are selected based on the values that minimizes:
[0024]
[Math. 0006]


[0025]
The gradient calculation for integer pixel resolution is shown as follows:
[0026]
[Math. 0007]


[0027]
[Math. 0008]


[0028]
For fractional pixel resolution, interpolation will be performed first and the gradient is calculated as follows:
[0029]
[Math. 0009]


[0030]
[Math. 0010]


[0031]
[Math. 0011]


[0032]
[Math. 0012]


[0033]
In the above equations, α is block motion vector, R (k) [i, j] is reference picture value in integer position [i, j] for references k=0 or 1, F n (α) is filter directly providing derivatives.
[0034]
For x-directional gradient, if the y-location is an integer, the luma gradient filter is applied. If the y-location is fractional, interpolation in the y direction is performed and luma gradient filter is applied in the x direction. For y-directional gradient, if the x-location is an integer, the luma gradient filter is applied. If the x-location is fractional, luma gradient filter is applied in the y direction and interpolation in the x direction is performed .
[0035]
In the existing BIO implementation, the window size for v x [i, j] and v y [i, j] are 5x5 and BIO is only applied to the luma component with truly bi-predicted 2N×2N coding units (CUs) only. For gradient calculation at fractional pixel resolution, an additional 6-tap interpolation/gradient filter is used. Furthermore, the vertical process is performed first followed by the horizontal process.
[0036]
SUMMARY
[0037]
A method and apparatus of motion compensation using the bi-directional optical flow (BIO) techniques are disclosed. According to one method of the present invention, the use of BIO is extended to general bi-prediction motion compensation by including the case that two reference pictures correspond to two previously coded pictures. In one embodiment, the two x-offset values and two y-offset values for two corresponding positions in two reference blocks have same values, but opposite sign. In another embodiment, the two x-offset values and two y-offset values for two corresponding positions in two reference blocks have same values as well as the sign. In yet another embodiment, the two x-offset values and two y-offset values for two corresponding positions in two reference blocks are proportional to two relative temporal distances between the first reference picture and the current picture and between the second reference picture and the current picture.
[0038]
According to another method of the present invention, the use of BIO is adaptively applied depending on the linearity of the two motion vectors associated with the two reference blocks or depending on block size of the current block. For example, the current block is encoded or decoded using the bi-directional optical-flow prediction if the linearity of the first motion vector and the second motion vector satisfies a linearity threshold or if the block size of the current block is larger than a threshold block size.
[0039]
According to yet another method of the present invention, the refined motion vectors by compensating the original motion vectors with the respective x-offset values and y-offset values are stored in a motion-vector buffer for motion vector prediction of one or more following blocks. If the bi-directional optical-flow prediction is applied to the current block on block-level basis for sub-blocks of the current block, the refined motion vectors associated with the sub-blocks are stored in the motion-vector buffer.
[0040]
BRIEF DESCRIPTION OF DRAWINGS
[0041]
Fig. 1 illustrates an example of motion compensation using bi-directional optical flow technique.
[0042]
Fig. 2 illustrates an exemplary flowchart of a video coding system incorporating an embodiment of the present invention, where the use of BIO is extended to general bi-prediction motion compensation by including the case that two reference pictures correspond to two previously coded pictures.
[0043]
Fig. 3 illustrates an exemplary flowchart of a video coding system incorporating another embodiment of the present invention, where the use of BIO is adaptively applied depending on the linearity of the two motion vectors associated with the two reference blocks or depending on block size of the current block.
[0044]
Fig. 4 illustrates an exemplary flowchart of a video coding system incorporating another embodiment of the present invention, where the refined motion vectors by compensating the original motion vectors with the respective x-offset values and y-offset values are stored in a motion-vector buffer for motion vector prediction of one or more following blocks.

DETAILED DESCRIPTION

[0045]
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
[0046]
In VCEG-AZ05, the Bi-directional Optical flow (BIO) is implemented as an additional process to the process as specified in the HEVC reference software. The motion compensated prediction according to the conventional HEVC is generated as shown in eq. (1) . On the other hand, the motion compensated prediction according to BIO is shown in eq. (2) , where additional parameters are determined to modify the conventional motion compensated prediction. The BIO is always applied to those blocks that are predicted with true bi-directions. In order to avoid increasing the memory bandwidth in the worst case, a method of the present invention only applies BIO to larger blocks. For example, an 8-tap interpolation filter for the luma component and a 4-tap interpolation filter for the chroma component are used to perform fractional motion compensation in HEVC. In the case of using a 5×5 window for each to-be-processed pixel as specified in BIO, the worst-case bandwidth is increased from 3.52 (i.e., (8+7) × (8+7) / (8x8) ) to 5.64 (i.e., (8+7+4) × (8+7+4) / (8×8)) samples accessed per to-be-processed sample per reference frame. If only blocks with size larger than 8x8 are allowed for the BIO process, the worst case memory requirement for each pixel in BIO is reduced from 5.64 to 2.84 (i.e., (16+7+4) × (16+7+4) / (16×16) ) , which is even smaller than the original worst-case bandwidth (i.e., 3.52 samples accessed per to-be-processed sample per reference frame) . Therefore, the worst-case memory bandwidth will not be increased by restricting the BIO process to block sizes larger than a threshold block size (e.g. 8x8) according to the present invention.
[0047]
A method is disclosed to reduce the complexity and/or cost associated with the BIO process. According to this method, the gradient filter and the interpolation filter in BIO are unified with the interpolation filter for fractional motion compensation. Currently, the gradient filter and the interpolation filter in BIO are additional processes to the conventional HEVC. These filters are different from the interpolation filter used for motion compensation. The BIO related filters cause additional cost to the BIO process. However, the purpose of the interpolation filter in BIO and the purpose of the interpolation filter in motion compensation are similar since both are intended for approximating the fractional-pel motion. Furthermore, these filters will derive the related information such as interpolated pixel values and gradient values. The gradient filter in BIO can be derived directly from the interpolation filter in BIO. The method will further unify the interpolation filter in BIO with the interpolation filter in fractional-pel motion compensation, and derives the gradient filter from the interpolation filter.
[0048]
According to the method of unifying interpolation filters as disclosed above, there is no need for an additional interpolation filter. Therefore, the computation becomes unified and simplified. An 8-tap interpolation filter or 4-tap interpolation filer can be used instead of 6-tap interpolation filter as specified in BIO. When 8-tap interpolation filter is used, the gradient filter is also changed and derived directly from the difference between filter coefficients with different fractional positions. For example, for the fractional position equal to 1/2-pel, the gradient filter coefficients can be derived from the differences between the interpolation filter coefficients for the fractional position equal to 3/4-pel and the interpolation filter coefficients for the fractional position equal to 1/4-pel divided by 2× (1/4) . The coding performance of BIO is improved because of the same interpolation filter is used for BIO and motion compensation. However, the computational complexity is increased also. If a 4-tap interpolation filter is used, no additional filter is required and the computation complexity can be further reduced.
[0049]
Another method to improve the performance of BIO is to apply BIO for all bi-directional predicted blocks regardless of whether the blocks are “true bi-prediction” or not. According to the assumption of optical flow and steady motion, the corresponding equations and solutions for bi-directional predicted blocks can be used, where both reference frames are previously coded frames by using a similar approach. For example, the x-offset values and the y-offset values for the two corresponding positions (i.e., position A and B in Fig. 1) have the same value, but opposite sign. Accordingly, the x-offset values and the y-offset values for two corresponding positions in two reference blocks of two previously coded frames may have the same value, but opposite sign. In the assumption of steady motion, the temporal distances between current block and two references blocks can be taken into account in the equations. For example, POC (picture order count) is often used for temporal distance. If the temporal distances between current block and two references blocks are m and n, the x-offset values and the y-offset values for two corresponding positions in two reference blocks of two previously coded frames can be proportional to m and n, where m and n are integers. In another embodiment, only the temporal direction should be considered in the corresponding equation for simplicity. In this case, the x-offset values and the y-offset values for two corresponding positions in two reference blocks of two previously coded frames may have the same value and the same sign.
[0050]
In VCEG-AZ05 the BIO is applied in pixel-level basis. In an embodiment of the present invention, the process of the BIO is applied in the block-level basis. The block size can be N×M, where N and M are integers. All the pixels in an N×M block can share the same motion refinement. If N and M are equal to or greater than 4, the refined motion vector can be stored back to the MV buffers.
[0051]
The BIO can be applied to sub-PUs (prediction units) . For example, if a PU block is allowed for sub-PU partition and each sub-PU can have different motion information or modes, the BIO can be applied to each sub-PU. The initial MV for BIO can be different for each sub-PU.
[0052]
In yet another embodiment, the BIO and the methods disclosed above can also be extended to the blocks (pixels) of multiple-hypothesis prediction such as Inter-prediction with more than two reference blocks (pixels) .
[0053]
In still yet another embodiment, the BIO operations can be adaptively applied according to the gradient calculations on P (0) and P (1) or the hybrid predictor (P (0) + P (1) ) . For example, when the difference between the list0 gradient and list1 gradient is larger than a predefined threshold, the BIO is not applied.
[0054]
In still yet another embodiment, the BIO operations can be adaptively applied according to the linearity of motion vectors that generates P (0) and P (1) . In other words, if the motion vectors that generates P (0) and P (1) do not follow linear motion assumption, the refined pixel motions, v x and v y, are not reliable. Therefore, the decoder can check the linearity to adaptively apply BIO according to an embodiment of the present invention. For example, the BIO operations can be applied only if the linearity of motion vectors meets a required condition. For example, the current block can be encoded or decoded using the bi-directional optical-flow prediction only if the linearity of the first motion vector and the second motion vector satisfies a linearity threshold.
[0055]
In still yet another embodiment, if the motion vectors that generate P (0) and P (1) do not follow linear motion assumption, the decoder can calculate BIO according to the direction of the motion vectors that generates P (0) and P (1) . For example, the decoder can derive pixel motion vectors in proportion to the motion vectors that generate P (0) and P (1) .
[0056]
In still yet another embodiment, the offsets calculated in the BIO process can be viewed as an offset to refine the motion vectors for all pixels in current block. The refined MVs can be stored in the MV buffer and used for the MV prediction of the following blocks. Note that, if the BIO is performed in a block level (e.g. 4×4 block) , the refined MVs are also stored in the block level.
[0057]
Fig. 2 illustrates an exemplary flowchart of a video coding system incorporating an embodiment of the present invention, where the use of BIO is extended to general bi-prediction motion compensation by including the case that two reference pictures correspond to two previously coded pictures. According to this method, input data associated with a current block in a current picture is received in step 210. A first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector are determined in step 220, where the first reference picture and the second reference picture are two previously coded pictures. The x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block is determined in step 230. The y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block is determined in step 240. An x-offset value and a y-offset value are determined according to an optical flow model in step 250, where the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block. Bi-directional optical-flow prediction corresponding to the given position is derived based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value as shown in step 260. Pixel data at the given position of the current block is encoded or decoded using the bi-directional optical-flow prediction corresponding to the given position as shown in step 270.
[0058]
Fig. 3 illustrates an exemplary flowchart of a video coding system incorporating another embodiment of the present invention, where the use of BIO is adaptively applied depending on the linearity of the two motion vectors associated with the two reference blocks or depending on block size of the current block. According to this method, input data associated with a current block in a current picture is received in step 310. A first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector are determined in step 320. The x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block is determined in step 330. The y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block is determined in step 340. An x-offset value and a y-offset value are determined according to an optical flow model in step 350, where the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block. Bi-directional optical-flow prediction corresponding to the given position is derived based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value as shown in step 360. Pixel data at the given position of the current block is encoded or decoded using the bi-directional optical-flow prediction or not depending on linearity of the first motion vector and the second motion vector or depending on block size of the current block as shown in step 370.
[0059]
Fig. 4 illustrates an exemplary flowchart of a video coding system incorporating another embodiment of the present invention, where the refined motion vectors by compensating the original motion vectors with the respective x-offset values and y-offset values are stored in a motion-vector buffer for motion vector prediction of one or more following blocks. According to this method, input data associated with a current block in a current picture is received in step 410. A first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector are determined in step 420. The x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block is determined in step 430. The y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block is determined in step 440. An x-offset value and a y-offset value are determined according to an optical flow model in step 450, where the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block. Bi-directional optical-flow prediction corresponding to the given position is derived based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value as shown in step 460. Pixel data at the given position of the current block is encoded or decoded using the bi-directional optical-flow prediction corresponding to the given position as shown in step 470. The refined motion vectors for bi-directional optical-flow predicted pixels of the current block are stored in a motion-vector buffer for motion vector prediction of one or more following blocks in step 480, where the refined motion vectors are determined based on the first motion vector or the second motion vector modified by the x-offset value and the y-offset value.
[0060]
The flowcharts shown are intended to illustrate an example of video coding according to the present invention. A person skilled in the art may modify each step, re-arranges the steps, split a step, or combine steps to practice the present invention without departing from the spirit of the present invention. In the disclosure, specific syntax and semantics have been used to illustrate examples to implement embodiments of the present invention. A skilled person may practice the present invention by substituting the syntax and semantics with equivalent syntax and semantics without departing from the spirit of the present invention.
[0061]
The above description is presented to enable a person of ordinary skill in the art to practice the present invention as provided in the context of a particular application and its requirement. Various modifications to the described embodiments will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. In the above detailed description, various specific details are illustrated in order to provide a thorough understanding of the present invention. Nevertheless, it will be understood by those skilled in the art that the present invention may be practiced.
[0062]
Embodiment of the present invention as described above may be implemented in various hardware, software codes, or a combination of both. For example, an embodiment of the present invention can be one or more circuit circuits integrated into a video compression chip or program code integrated into video compression software to perform the processing described herein. An embodiment of the present invention may also be program code to be executed on a Digital Signal Processor (DSP) to perform the processing described herein. The invention may also involve a number of functions to be performed by a computer processor, a digital signal processor, a microprocessor, or field programmable gate array (FPGA) . These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention. The software code or firmware code may be developed in different programming languages and different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, styles and languages of software codes and other means of configuring code to perform the tasks in accordance with the invention will not depart from the spirit and scope of the invention.
[0063]
The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.

Claims

[Claim 1]
A method of motion compensation for video data, the method comprising: receiving input data associated with a current block in a current picture; determining a first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector, wherein the first reference picture and the second reference picture are two previously coded pictures; deriving x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block; deriving y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block; determining an x-offset value and a y-offset value according to an optical flow model, wherein the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block; deriving bi-directional optical-flow prediction corresponding to the given position based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value; and encoding or decoding pixel data at the given position of the current block using the bi-directional optical-flow prediction corresponding to the given position.
[Claim 2]
The method of Claim 1, wherein two x-offset values for the first position and the second position have a same x-offset value with an opposite sign and two y-offset values for the first position and the second position have a same y-offset value with the opposite sign.
[Claim 3]
The method of Claim 1, wherein two x-offset values for the first position and the second position have a same x-offset value with a same sign and two y-offset values for the first position and the second position have a same y-offset value with the same sign.
[Claim 4]
The method of Claim 1, wherein two x-offset values for the first position and the second position are proportional to two relative temporal distances between the first reference picture and the current picture and between the second reference picture and the current picture and two y-offset values for the first position and the second position are proportional to the two relative temporal distances between the first reference picture and the current picture and between the second reference picture and the current picture.
[Claim 5]
An apparatus for motion compensation of video data performed by a video coding system, the apparatus comprising one or more electronic circuits or processors configured to: receive input data associated with a current block in a current picture; determine a first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector, wherein the first reference picture and the second reference picture are two previously coded pictures; derive x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block; derive y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block; determine an x-offset value and a y-offset value according to an optical flow model, wherein the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block; derive bi-directional optical-flow prediction corresponding to the given position based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value; and encode or decode pixel data at the given position of the current block using the bi-directional optical-flow prediction corresponding to the given position.
[Claim 6]
The apparatus of Claim 5, wherein two x-offset values for the first position and the second position have a same x-offset value with an opposite sign and two y-offset values for the first position and the second position have a same y-offset value with the opposite sign.
[Claim 7]
The apparatus of Claim 5, wherein two x-offset values for the first position and the second position have a same x-offset value with a same sign and two y-offset values for the first position and the second position have a same y-offset value with the same sign.
[Claim 8]
The apparatus of Claim 5, wherein two x-offset values for the first position and the second position are proportional to two relative temporal distances between the first reference picture and the current picture and between the second reference picture and the current picture and two y-offset values for the first position and the second position are proportional to the two relative temporal distances between the first reference picture and the current picture and between the second reference picture and the current picture.
[Claim 9]
A method of motion compensation for video data, the method comprising: receiving input data associated with a current block in a current picture; determining a first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector; deriving x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block; deriving y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block; determining an x-offset value and a y-offset value according to an optical flow model, wherein the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block; deriving bi-directional optical-flow prediction corresponding to the given position based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value; and encoding or decoding pixel data at the given position of the current block using the bi-directional optical-flow prediction or not depending on linearity of the first motion vector and the second motion vector or depending on block size of the current block.
[Claim 10]
The method of Claim 9, wherein the current block is encoded or decoded using the bi-directional optical-flow prediction if the linearity of the first motion vector and the second motion vector satisfies a linearity threshold.
[Claim 11]
The method of Claim 9, wherein the current block is encoded or decoded using the bi-directional optical-flow prediction if the block size of the current block is larger than a threshold block size.
[Claim 12]
The method of Claim 11, wherein the threshold block size is 8x8.
[Claim 13]
An apparatus for motion compensation of video data performed by a video coding system, the apparatus comprising one or more electronic circuits or processors configured to: receive input data associated with a current block in a current picture; determine a first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector; derive x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block; derive y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block; determine an x-offset value and a y-offset value according to an optical flow model, wherein the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block; derive bi-directional optical-flow prediction corresponding to the given position based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value; and encode or decode pixel data at the given position of the current block using the bi-directional optical-flow prediction or not depending on linearity of the first motion vector and the second motion vector or depending on block size of the current block.
[Claim 14]
The apparatus of Claim 13, wherein the current block is encoded or decoded using the bi-directional optical-flow prediction if the linearity of the first motion vector and the second motion vector satisfies a linearity threshold.
[Claim 15]
The apparatus of Claim 13, wherein the current block is encoded or decoded using the bi-directional optical-flow prediction if the block size of the current block is larger than a threshold block size.
[Claim 16]
The apparatus of Claim 15, wherein the threshold block size is 8x8.
[Claim 17]
A method of motion compensation for video data, the method comprising: receiving input data associated with a current block in a current picture; determining a first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector; deriving x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block; deriving y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block; determining an x-offset value and a y-offset value according to an optical flow model, wherein the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block; deriving bi-directional optical-flow prediction corresponding to the given position based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value; encoding or decoding pixel data at the given position of the current block using the bi-directional optical-flow prediction corresponding to the given position; and storing refined motion vectors for bi-directional optical-flow predicted pixels of the current block in a motion-vector buffer for motion vector prediction of one or more following blocks, wherein the refined motion vectors are determined based on the first motion vector or the second motion vector modified by the x-offset value and the y-offset value.
[Claim 18]
The method of Claim 17, wherein if the bi-directional optical-flow prediction is applied to the current block on block-level basis for sub-blocks of the current block, the refined motion vectors associated with the sub-blocks are stored in the motion-vector buffer.
[Claim 19]
An apparatus for motion compensation of video data performed by a video coding system, the apparatus comprising one or more electronic circuits or processors configured to: receive input data associated with a current block in a current picture; determine a first reference block in a first reference picture based on a first motion vector and a second reference block in a second reference picture based on a second motion vector; derive x-direction gradient difference corresponding to a given position of the current block between first x-direction gradient of the first reference block and second x-direction gradient of the second reference block; derive y-direction gradient difference corresponding to the given position of the current block between first y-direction gradient of the first reference block and second y-direction gradient of the second reference block; determine an x-offset value and a y-offset value according to an optical flow model, wherein the x-offset value and the y-offset value are selected to obtain a reduced or minimum flow difference between a first position and a second position, and the first position and the second position are two positions in the first reference block and the second reference block respectively corresponding to the given position of the current block; derive bi-directional optical-flow prediction corresponding to the given position based on the first reference block, the second reference block, the x-direction gradient difference weighted by the x-offset value, and the y-direction gradient difference weighted by the y-offset value; encode or decode pixel data at the given position of the current block using the bi-directional optical-flow prediction corresponding to the given position; and store refined motion vectors for bi-directional optical-flow predicted pixels of the current block in a motion-vector buffer for motion vector prediction of one or more following blocks, wherein the refined motion vectors are determined based on the first motion vector or the second motion vector modified by the x-offset value and the y-offset value.
[Claim 20]
The apparatus of Claim 19, wherein if the bi-directional optical-flow prediction is applied to the current block on block-level basis for sub-blocks of the current block, the refined motion vectors associated with the sub-blocks are stored in the motion-vector buffer.

Drawings

[ Fig. 0001]  
[ Fig. 0002]  
[ Fig. 0003]  
[ Fig. 0004]