Method and apparatus of bi-directional optical flow displacement fusion for video coding
Patent Information
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- MEDIATEK INC
- Filing Date
- 2024-08-01
- Publication Date
- 2026-06-10
AI Technical Summary
Existing video coding technologies face challenges in efficiently refining motion vectors using bi-directional optical flow, particularly in terms of high computational complexity and bit-depth requirements.
The method involves using bi-directional optical flow (BDOF) to refine motion vectors by determining separate motion offsets for list 0 and list 1 reference blocks, without constraining their magnitudes, and then combining these offsets to derive a bi-directional prediction offset value.
This approach improves coding efficiency by minimizing differences between predictors from different reference pictures, reducing computational complexity, and optimizing bit-depth usage, thereby enhancing video quality and compression performance.
Smart Images

Figure CN2024109216_06022025_PF_FP_ABST
Abstract
Description
METHOD AND APPARATUS OF BI-DIRECTIONAL OPTICAL FLOW DISPLACEMENT FUSION FOR VIDEO CODING
[0001] CROSS REFERENCE TO RELATED APPLICATIONS
[0002] The present invention claims priority to U.S. Provisional Patent Application, Serial No. 63 / 530, 555, filed on August 3, 2023 and U.S. Provisional Patent Application, Serial No. 63 / 597, 352, filed on November 9, 2023. The U.S. Provisional Patent Applications are hereby incorporated by reference in their entireties.FIELD OF THE INVENTION
[0003] The present invention relates to bi-directional prediction for MV refinement based on BDOF (Bi-Directional Optical Flow) .
[0004] BACKGROUND AND RELATED ART
[0005] Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) . The standard has been published as an ISO standard: ISO / IEC 23090-3: 2021, Information technology -Coded representation of immersive media -Part 3: Versatile video coding, published Feb. 2021. VVC is developed based on its predecessor HEVC (High Efficiency Video Coding) by adding more coding tools to improve coding efficiency and also to handle various types of video sources including 3-dimensional (3D) video signals.
[0006] Fig. 1A illustrates an exemplary adaptive Inter / Intra video encoding system incorporating loop processing. For Intra Prediction 110, the prediction data is derived based on previously coded video data in the current picture. For Inter Prediction 112, Motion Estimation (ME) is performed at the encoder side and Motion Compensation (MC) is performed based on the result of ME to provide prediction data derived from other picture (s) and motion data. Switch 114 selects Intra Prediction 110 or Inter Prediction 112 and the selected prediction data is supplied to Adder 116 to form prediction errors, also called residues. The prediction error is then processed by Transform (T) 118 followed by Quantization (Q) 120. The transformed and quantized residues are then coded by Entropy Encoder 122 to be included in a video bitstream corresponding to the compressed video data. The bitstream associated with the transform coefficients is then packed with side information such as motion and coding modes associated with Intra prediction and Inter prediction, and other information such as parameters associated with loop filters applied to underlying image area. The side information associated with Intra Prediction 110, Inter prediction 112 and in-loop filter 130, is provided to Entropy Encoder 122 as shown in Fig. 1A. When an Inter-prediction mode is used, a reference picture or pictures have to be reconstructed at the encoder end as well. Consequently, the transformed and quantized residues are processed by Inverse Quantization (IQ) 124 and Inverse Transformation (IT) 126 to recover the residues. The residues are then added back to prediction data 136 at Reconstruction (REC) 128 to reconstruct video data. The reconstructed video data may be stored in Reference Picture Buffer 134 and used for prediction of other frames.
[0007] As shown in Fig. 1A, incoming video data undergoes a series of processing in the encoding system. The reconstructed video data from REC 128 may be subject to various impairments due to a series of processing. Accordingly, in-loop filter 130 is often applied to the reconstructed video data before the reconstructed video data are stored in the Reference Picture Buffer 134 in order to improve video quality. For example, deblocking filter (DF) , Sample Adaptive Offset (SAO) and Adaptive Loop Filter (ALF) may be used. The loop filter information may need to be incorporated in the bitstream so that a decoder can properly recover the required information. Therefore, loop filter information is also provided to Entropy Encoder 122 for incorporation into the bitstream. In Fig. 1A, Loop filter 130 is applied to the reconstructed video before the reconstructed samples are stored in the reference picture buffer 134. The system in Fig. 1A is intended to illustrate an exemplary structure of a typical video encoder. It may correspond to the High Efficiency Video Coding (HEVC) system, VP8, VP9, H. 264 or VVC.
[0008] The decoder, as shown in Fig. 1B, can use similar or portion of the same functional blocks as the encoder except for Transform 118 and Quantization 120 since the decoder only needs Inverse Quantization 124 and Inverse Transform 126. Instead of Entropy Encoder 122, the decoder uses an Entropy Decoder 140 to decode the video bitstream into quantized transform coefficients and needed coding information (e.g. ILPF information, Intra prediction information and Inter prediction information) . The Intra prediction 150 at the decoder side does not need to perform the mode search. Instead, the decoder only needs to generate Intra prediction according to Intra prediction information received from the Entropy Decoder 140. Furthermore, for Inter prediction, the decoder only needs to perform motion compensation (MC 152) according to Inter prediction information received from the Entropy Decoder 140 without the need for motion estimation.
[0009] According to VVC, an input picture is partitioned into non-overlapped square block regions referred as CTUs (Coding Tree Units) , similar to HEVC. Each CTU can be partitioned into one or multiple smaller size coding units (CUs) . The resulting CU partitions can be in square or rectangular shapes. Also, VVC divides a CTU into prediction units (PUs) as a unit to apply prediction process, such as Inter prediction, Intra prediction, etc.
[0010] The VVC standard incorporates various new coding tools to further improve the coding efficiency over the HEVC standard. Furthermore, various new coding tools (for example, Decoder-Side Motion Vector Refinement (DMVR) , Bi-directional Optical Flow (BDOF) , and some other coding tools) have been proposed for consideration in the development of a new coding standard beyond the VVC.
[0011] Multi-Pass Decoder-Side Motion Vector Refinement (MP-DMVR)
[0012] In ECM-2.0, a Multi-Pass (MP) DMVR method is applied in regular merge mode if the selected merge candidate meets the DMVR conditions. In the first pass, bilateral matching (BM) is applied to the coding block. In the second pass, BM is applied to each 16x16 subblock within the coding block. In the third pass, MV in each 8x8 subblock is refined by applying bi-directional optical flow (BDOF) .
[0013] Similar to the DMVR in VVC, the BM refined a pair of motion vectors MV0 and MV1 under the constrain that MVD0 (MV0’-MV0) is just the opposite sign of MVD1 (MV1’-MV1) , as in Fig. 2.
[0014] In order to increase the accuracy of the MVs of the merge mode, a bilateral-matching (BM) based decoder side motion vector refinement is applied in VVC. In bi-prediction operation, a refined MV is searched around the initial MVs (232 and 234) in the reference picture list L0 212 and reference picture list L1 214 for a current block 220 the current picture 210. The collocated blocks 222 and 224 in L0 and L1 are determined according to the initial MVs 230 and 232) and the location of the current block 220 in the current picture as shown in Fig. 2. The BM method calculates the distortion between the two candidate blocks (242 and 244) in the reference picture list L0 and list L1. The locations of the two candidate blocks (242 and 244) are determined by adding two opposite offset (262 and 264) to the two initial MVs (232 and 234) to derive the two candidate MVs (252 and 254) . The SAD between the candidate blocks (242 and 244) based on each MV candidate around the initial MV (232 or 234) is calculated. The MV candidate (252 or 254) with the lowest SAD becomes the refined MV and used to generate the bi-predicted signal.
[0015] Adaptive Decoder Side Motion Vector Refinement (Adaptive MP-DMVR)
[0016] In JVET-X0049 (Han Huang, et al., “EE2: Adaptive decoder side motion vector refinement (test 3.4) ” , in Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 24th Meeting, by teleconference, 6–15 October 2021, Document: JVET-X0049) , adaptive decoder side motion vector refinement is disclosed. The adaptive decoder side motion vector refinement method consists of two new merge modes introduced to refine MV only in one direction, either L0 or L1, of the bi-prediction for the merge candidates that meet the DMVR conditions. The multi-pass DMVR process is applied for the selected merge candidate to refine the motion vectors, however either MVD0 or MVD1 is set to zero in the first pass (i.e. PU level) DMVR.
[0017] Like the regular merge mode, merge candidates for the proposed merge modes are derived from the spatial neighboring coded blocks, TMVPs (Temporal Motion Vector Predictions) , non-adjacent blocks, HMVPs (History-based Motion Vector Predictions) , and pair-wise candidate. The difference is that only those meet DMVR conditions are added into the candidate list. The same merge candidate list is used by the two proposed merge modes and merge index is coded as in regular merge mode. There are two syntax elements to indicate this mode, including bmMergeFlag and bmDirFlag. bmMergeFlag is used to indicate the on-off of this kind of prediction (refine MV only on one direction) . bmDirFlag is used to indicate the refined MV direction. For example, when bmDirFlag is equal to 0, the refined MV is from List0. When bmDirFlag is equal to 1, the refined MV is from List1. The syntax structure is shown in the following table.
[0018] Table 1. Syntax structure for bmMergeFlag and bmDirFlag
[0019] After decoding bm_merge_flag and bm_dir_flag, bmDir can be decided. For example, if bm_merge_flag is equal to 1 and bm_dir_flag is equal to 0, bmDir will be set as 1. Also, bmDir is used to represent the adaptive MP-DMVR and only refine the MV in List0. For another example, if bm_merge_flag is equal to 1 and bm_dir_flag is equal to 1, bmDir will be set as 2. Also, it is used to represent the adaptive MP-DMVR and only refine the MV in List1.
[0020] Bi-directional Optical Flow (BIO) / BDOF
[0021] Bi-directional optical flow (BIO or BDOF) 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) , 52nd 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 as shown in Fig. 3, where a current pixel 322 in a B-slice (bi-prediction slice) 320 is predicted by one pixel (332) in reference picture 0 (330) and one pixel (312) in reference picture 1 (310) . As shown in Fig. 3, the current pixel 322 is predicted by pixel B 312 in reference picture 1 (310) and pixel A 332 in reference picture 0 (330) . In Fig. 3, vx and vy are pixel displacement vector in the x-direction and y-direction, which are derived using a bi-directional optical flow (BIO) model. It is applied only for truly bi-directional predicted blocks, which is predicted from two reference pictures corresponding to the previous picture and the latter picture. 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 computational 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.
[0022] In a conventional bi-prediction in HEVC, the predictor is generated using equation (1) , where P (0) and P (1) are the list0 and list1 predictor, respectively. PConventional [i, j] = (P (0) [i, j] +P (1) [i, j] +1) >>1 (1)
[0023] In JCTVC-C204 and VECG-AZ05, the BIO predictor is generated using equation (2) . POpticalFlow= (P (0) [i, j] +P (1) [i, j] +vx [i, j] (Ix (0) -Ix (1) [i, j] ) + vy [i, j] (Iy (0) -Iy (1) [i, j] ) +1) >>1 (2)
[0024] In equation (2) , Ix (0) and Ix (1) represent the x-directional gradient in list0 and list1 predictor, respectively; Iy (0) and Iy (1) represent the y-directional gradient in list0 and list1 predictor, respectively; vx and vy represent the offsets or displacements in x-and y-direction, respectively. The derivation process of vx and vy is shown in the following. First, the cost function is defined as diffCost (x, y) to find the best values vx and vy. In order to find the best values vx and vy to minimize the cost function, diffCost (x, y) , one 5x5 window is used. The solutions of vx and vy can be represented by using S1, S2, S3, S5, and S6. diffCost (x, y)
[0025] The minimum cost function, min diffCost (x, y) can be derived according to:
[0026] By solving equations (3) and (4) , vx and vy can be solved according to eqn. (5) :
[0027] where,
[0028] We can find that the required bitdepth is large in BIO process, especially for calculating S1, S2, S3, S5, and S6. For example, if the bitdepth of pixel value in video sequences is 10 bits and the bitdepth of gradients is increased by fractional interpolation filter or gradient filter, then 16 bits are required to represent one x-directional gradient or one y-directional gradient. These 16 bits may be further reduced by gradient shift equal to 4, so one gradient needs 12 bits to represent the value. Even if the magnitude of gradient can be reduced to 12 bits by gradient shift, the required bitdepth of BIO operations is still large. One multiplier with 13 bits by 13 bits is required to calculate S1, S2, and S5, and another multiplier with 13 bits by 17 bits is required to get S3, and S6. When the window size is large, more than 32 bits may be required to represent S1, S2, S3, S5, and S6.
[0029] In the present invention, methods to improve the coding efficiency related to BDOF are disclosed.
[0030] BRIEF SUMMARY OF THE INVENTION
[0031] Method and apparatus of motion vector refinement using bi-directional prediction are disclosed. According to one method of the present invention, input data associated with a current block is received, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side. A first motion offset for a first predictor is determined based on a first reference picture and a second motion offset for a second predictor is determined based on a second reference picture separately by using a BDOF (Bi-Directional Optical Flow) motion model without a constraint for the first motion offset and the second motion offset to have a same magnitude, wherein the first motion offset is derived for a list 0 reference block and the second motion offset is derived for a list 1 reference block, wherein the first motion offset and the second motion offset are derived to minimize differences between the first predictor and the second predictor. A bi-directional prediction offset value corresponding to the linear combination of the first motion offset for the list 0 reference block and the second motion offset for the list 1 reference block is determined. A bidirectional predictor for the current block is derived based on the first predictor, the second predictor, and the bi-directional prediction offset value.
[0032] In one embodiment, a final predictor for the current block is derived by using a linear combination of a conventional predictor and the bidirectional prediction offset value. In one embodiment, the first motion offset and the second motion offset are derived using Gaussian elimination. In one embodiment, one or more regularization terms are added during said determining the first motion offset and the second motion offset to cause x-component of the first motion offset closer to - (x-component) of the second motion offset, y-component of the first motion offset closer to - (y-component) of the second motion offset, or both.
[0033] In one embodiment, the first motion offset and the second motion offset are derived by using an optical flow algorithm. In one embodiment, after the first motion offset and the second motion offset are derived by using the optical flow algorithm, a new first motion offset and a new second motion offset are derived by using a regression method based on the first motion offset and the second motion offset. In one embodiment, one or more regularization terms are added to constrain a motion offset difference between the first motion offset and the second motion offset and the new first and second motion offsets. In one embodiment, said one or more regularization terms are designed based on bit-depth of a current picture, a current coded mode, or QP of the current block.
[0034] In one embodiment, a sample difference between the first predictor and the second predictor is represented by an alternative form corresponding to a second linear combination of first alternative x-component and first alternative y-component of a first alternative motion offset, and second alternative x-component and second alternative y-component of a second alternative motion offset, wherein weights for the second linear combination correspond to first sum of a first x-gradient and a second x-gradient, second sum of a first y-gradient and a second y-gradient, a first difference between the first x-gradient and the second x-gradient, a second difference between the first y-gradient and the second y-gradient respectively, and wherein the first motion offset and the second motion offset are derived from the first alternative motion offset and the second alternative motion offset.
[0035] In one embodiment, a first x-component of the first motion offset corresponds to a third sum of the first alternative x-component of the first alternative motion offset and the second alternative x-component of the second alternative motion offset, a second x-component of the second motion offset corresponds to a third difference between the first alternative x-component of the first alternative motion offset and the second alternative x-component of the second alternative motion offset, a first y-component of the first motion offset corresponds to a fourth sum of the first alternative y-component of the first alternative motion offset and the second alternative y-component of the second alternative motion offset, and a second y-component of the second motion offset corresponds to a fourth difference between the first alternative y-component of the first alternative motion offset and the second alternative y-component of the second alternative motion offset.
[0036] In one embodiment, one or more regularization terms are added to constrain to cause the first alternative motion offset to be much larger than the second alternative motion offset. In one embodiment, the second alternative motion offset is treated as a refinement of the first alternative motion offset. In one embodiment, only if the first alternative motion offset is much larger than the second alternative motion offset, the first alternative motion offset and the second alternative motion offset are used to derive the first motion offset and the second motion offset. In one embodiment, if the first alternative motion offset is not much larger than the second alternative motion offset, original bidirectional optical flow model is used to derive the first motion offset and the second motion offset, and the first motion offset and the second motion offset have a same magnitude. In one embodiment, a first final motion offset and a second final motion offset are derived by using a weighted sum of the first alternative motion offset and the second alternative motion offset.BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Fig. 1A illustrates an exemplary adaptive Inter / Intra video coding system incorporating loop processing.
[0038] Fig. 1B illustrates a corresponding decoder for the encoder in Fig. 1A.
[0039] Fig. 2 illustrates the process of Adaptive Decoder side Motion Vector Refinement (Adaptive DMVR.
[0040] Fig. 3 illustrates the process of Bi-directional optical flow (BIO) or Bi-Directional Optical Flow (BDOF) .
[0041] Fig. 4 illustrates an exemplary flowchart of a video coding system using Bi-Directional Optical Flow (BDOF) to refine bi-direction predicted according to an embodiment of the present invention.DETAILED DESCRIPTION OF THE INVENTION
[0042] It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the systems and methods of the present invention, as represented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. References throughout this specification to “one embodiment, ” “an embodiment, ” or similar language mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment.
[0043] Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, or operations are not shown or described in detail to avoid obscuring aspects of the invention. The illustrated embodiments of the invention will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain selected embodiments of apparatus and methods that are consistent with the invention as claimed herein.
[0044] Scheme 1: BDOF with BCW
[0045] In one embodiment, BDOF can be applied on non-equal weight bi-prediction.
[0046] In one embodiment, non-equal weights of BCW can be considered during BDOF motion displacement derivation. The parameters of BDOF derived from the side with larger BCW weights can be multiplied with larger weights before displacement derivation. For example, if the BCW weight for L0 is w0, and the weight for L1 is w1. After gradX0, and gradY0 are derived, they will be multiplied by w0 before further calculation. After gradX1, and gradY1 are derived, they will be multiplied by w1 before further calculation.
[0047] In one embodiment, non-equal weights of BCW can be considered during BDOF motion displacement derivation. The parameters of BDOF derived from the side with larger BCW weights can be multiplied with smaller weights before displacement derivation. For example, if the BCW weight for L0 is w0, and the weight for L1 is w1. After gradX0, and gradY0 are derived, they will be multiplied by w1 before further calculation. After gradX1, and gradY1 are derived, they will be multiplied by w0 before further calculation.
[0048] In one embodiment, non-equal weights of BCW and the POC distances between the current picture and reference L0 and between the current picture and reference picture L1 can be considered together during BDOF motion displacement derivation. For example, two weights are derived based on non-equal weights of BCW and the POC distancse between the current picture and reference L0 and between the current picture and reference picture L1. The first weight will be multiplied with gradX0 and gradY0 before further calculation. The second weight will be multiplied with gradX1 and gradY1 before further calculation.
[0049] In one embodiment, non-equal weights of BCW can be considered during BDOF predictor blending process. In traditional BDOF bi-prediction blending process, the following formula is used. P0 + P1+vx* (gradX0-gradX1) + vy* (gradY0-gradY1) ,
[0050] where P0 and P1 is two predictors for L0 and L1 respectively, and (vx, vy) is one two-dimensional motion displacement derived by BDOF algorithm.
[0051] For example, when non-equal weight of BCW is applied, weight for L0 is w0 and weight for L1 is w1, the following blending formula can be used.
[0052] w0*P0 + w1*P1+vx* (w1*gradX0-w0*gradX1) + vy* (w1*gradY0-w0*gradY1) .
[0053] For another example, when non-equal weight of BCW is applied, weight for L0 is w0 and weight for L1 is w1, the following blending formula can be used.
[0054] w0*P0 + w1*P1+vx* (w0*gradX0-w1*gradX1) + vy* (w0*gradY0-w1*gradY1) .
[0055] For another example, when non-equal weight of BCW is applied, weight for L0 is w0 and weight for L1 is w1, the following blending formula can be used.
[0056] w0*P0 + w1*P1+vx* (a*gradX0-b*gradX1) + vy* (a*gradY0-b*gradY1) , where a, and b are two weighting parameters derived based on BCW non-equal weights. Also, a and b can be two weighting parameters derived based on POC distances between the current picture and reference picture L0 and between the current picture and reference picture L1 respectively.
[0057] In another embodiment, one on / off control flag is signalled at CU level, slice level, picture level, and / or sequence level to indicate whether the proposed method in the above is enabled or not.
[0058] In another embodiment, the proposed method in the above is enabled or disabled, according to one or a combination of the selected reference pictures indices, temporal distance between the reference picture and the current picture, quantization parameter, the coded information of the current CU, prediction mode, motion vectors, motion vector resolution, residual of the current CU, and reference samples.
[0059] Scheme 2: Decoupling BDOF Motion Displacements
[0060] In one embodiment, two motion displacement pairs can be derived in BDOF process, where one motion pair (vx0, vy0) is used to refine list0 motion and the other motion pair (vx1, vy1) is used to refine list1 motion. There is no constraint for the signs of (vx0, vy0) , and (vx1, vy1) .
[0061] In one embodiment, one regression-based method is applied to derive BDOF motion displacements. Motion displacements (i.e., vx0, vy0, vx1, vy1) are 4 parameters needed to be determined. In other words, the motion displacements (i.e., vx0, vy0, vx1, vy1) correspond to a first motion offset (i.e., (vx0, vy0) ) and a second motion offset (i.e., (vx1, vy1) ) . The inputs of the regression model of BDOF are x-axis gradient value and y-axis gradient of list0 and list1. The derivation formula is shown below. P1-P0 = gradX0*vx0 + gradY0*vy0 + gradX1*vx1 + gradY1*vy1,
[0062] where P0 and P1 are two predictors for L0 and L1 respectively.
[0063] It can be re-formula as following: Ax = B, (7)
[0064] where {a, b, c, d} represents {vx0, vy0, vx1, vy1} , {X0, X1, X2, X3} represents {gradX0, gradY0, gradX1, gradY1} , and y represents the difference between predictors L0 and L1 (i.e., (P1-P0) ) .
[0065] In one embodiment, Gaussian elimination can be used to derive a, b, c, and d.
[0066] In one embodiment, a regularization term can be added to make vx0 and vx1 closer and make vy0 and vy1 closer. For example, a regularization term is added on all diagonal terms of matrix A. The regularization terms are associated with the strength of the constraints.
[0067] In one embodiment, a regulation term can be added to make vx0 and -vx1 closer and make vy0 and -vy1 closer. For example, a regularization term is added on all diagonal terms of matrix A. The regularization terms are associated with the strength of the constraints.
[0068] In one embodiment, the strength of the similarity of vx0 and -vx1 and the strength of the similarity of vy0 and -vy1 can be different or the same.
[0069] In one embodiment, the regularization term related to the similarity of vx0 and -vx1 and the similarity of vy0 and -vy1 can be a fraction of the first elements in matrix A (e.g., )
[0070] In one embodiment, the regularization term related to the similarity of vx0 and -vx1 and the similarity of vy0 and -vy1 can be derived by right shifting by N bits of one element in matrix A (e.g. ) . N can be any integer larger than 0.
[0071] In one embodiment, the regularization can be designed based on the bit-depth of the current picture, the current coded mode, or QP of the current block.
[0072] In another embodiment, the regularization term is dependent on one or a combinations of the temporal distances between the selected reference pictures and the current picture respectively, motion vectors, the difference / similarity between two motion vectors, the coded information of the current CU, motion vector resolution, residual of current CU, quantization parameter, and prediction mode.
[0073] In one embodiment, BDOF first motion displacements can be derived by an optical flow algorithm and Taylor’s expansion. After that, the regression method is used to derived second motion displacements, where a regularization term is added to constrain the difference between the first motion displacements and second motion displacements. For example, a regularization term is added on all diagonal terms of matrix A and other regularization term is added on each element of vector B. Two regularization terms are associated with the strength of the related constraints.
[0074] In one embodiment, one regression-based method can be applied to derive BDOF motion displacements. Motion displacements (i.e., MVAx’, MVAy’, MVBx’, MVBy’ ) are 4 parameters needed to be determined. The inputs of the regression model of BDOF are x-axis gradient value and y-axis gradient of list 0 and list 1. The derivation formula is shown below: P1-P0 = (gradX0 + gradX1) *MVAx’ + (gradY0+gradY1) *MVAy’ + (gradX0 - gradX1) *MVBx’ + (gradY0-gradY1) *MVBy’,
[0075] where P0 and P1 are two predictors for L0 and L1.
[0076] Similar to the derivation shown in equations (7) and (8) above, it can be re-formula as following: Ax = b, (9)
[0077] where {a, b, c, d} represents {MVAx’, MVAy’, MVBx’, MVBy’ } , {X0, X1, X2, X3} represents {gradX0+gradX1, gradY0+gradY1, gradX0-gradX1, gradY0-gradY1} , and y represents the difference between predictors derived based on L0 and L1, (i.e., y = (P1-P0) ) . In this disclosure, (MVAx’, MVAy’ ) is referred as the first alternative motion offset and (MVBx’, MVBy’ ) is referred as the second alternative motion offset.
[0078] The final derived motion displacement of BDOF, vx0, vy0, vx1, and vy1 of BDOF can be formulated as following: vx0 = MVAx’ + MVBx’ (11) vx1 = MVAx’-MVBx’ (12) vy0 = MVAy’ + MVBy’ (13) vy1 = MVAy’-MVBy’ (14)
[0079] where vx0 is the motion displacement for x-axis of list 0; vy0 is the motion displacement for y-axis of list 0; vx1 is the motion displacement for x-axis of list 1; and vy1 is the motion displacement for y-axis of list 1.
[0080] In one embodiment, Gaussian elimination can be used to derive a, b, c, and d.
[0081] In one embodiment, regularization terms can be added to constrain MVAx’ and MVAy’ to be much larger than MVBx’ and MVBy’. MVBx’ and MVBy’ can be treated as finer refinements of MVAx’ and MVAy’. In that, the regularization terms are added on ∑yX2, and ∑yX3 terms only.
[0082] In one embodiment, only if the derived MVAx’ and MVAy’ are much larger than MVBx’ and MVBy’, the derived MVAx’, MVAy’, MVBx’, and MVBy’ will be used to generate final BDOF displacement vx0, vx1, vy0, and vy1. Otherwise, it will be fallback to original BDOF method (i.e., optical flow traditional derivation) to derive final BDOF displacements.
[0083] For example, only if MVBx’ *N and MVBy’ *N are smaller than MVAx’ and MVAy’, regression-based will be used to derive the final BDOF displacements. N can be any value larger than 1. N can be designed based on the block size, prediction mode, current QP, reference picture POC difference, etc.
[0084] In one embodiment, Gradient value sum of a subblock can be used to indicate whether the regression-based displacement derivation will be used or the optical flow traditional derivation will be used.
[0085] In one embodiment, only if the derived MVAx’ and MVAy’ are much larger than MVBx’ and MVBy’, the derived MVAx’, MVAy’, MVBx’, and MVBy’ will be used to generate the final BDOF displacements: vx0, vx1, vy0, and vy1. Otherwise only the derived MVAx’ and MVAy’ are used as final BDOF displacements.
[0086] While equations (11) - (14) illustrate an example of deriving the final motion offsets based on alternative motion offsets, the final BDOF displacements can be derived as the weighted sum of MVAx’, MVAy’, MVBx’, and MVBy’ according to one embodiment. For example, vx0 = MVAx’ + 0.25*MvBx’; vx1 = MVAx’-0.25*MvBx’; vy0 = MVAy’ +0.25*MvBy’; vy1 = MVAy’-0.25*MvBy’; The weights can be pre-defined fixed values or be designed based on initial MV, QP, reference picture selection, the difference between L0 and L1 predictors / gradients, or any combination thereof.
[0087] In one embodiment, the above-mentioned gradient value sum can also be the sum of predictor difference, or other features derived based on gradient values. Depended on a feature and a pre-defined threshold, regression-based displacement derivation will be selected in some cases, and optical flow traditional displacement derivation will be selected in other cases.
[0088] In one embodiment, whether to use regression-based displacement derivation is based on CU or PU block size. For example, if the block size is larger than 64, regression-based displacement derivation will be used; otherwise, optical flow traditional displacement derivation will be used.
[0089] In one embodiment, whether to use the regression-based displacement derivation is based on the combination of initial MV, QP, reference picture selection, and the difference between L0 and L1 predictors / gradients.
[0090] In one embodiment, the displacement derivation of BDOF can be included with mean-removal technology.
[0091] Scheme 3: One-side BDOF Refinement / BDOF with Non-Equal Distance Displacements Derivation
[0092] In one embodiment, the BDOF motion displacement can be derived under the condition that either MV0 or MV1 is fixed. The derived motion displacement can be applied to non-fixed MV or both of the MV0 and MV1.
[0093] For example, we consider that MV0 is fixed, and then derive the BDOF motion displacement (v′x, v′y) . The motion displacement is applied to MV1 only. The formula can be shown in the following equation. P0 + P1+v′x* (-gradX1) + v′y* (-gradY1) .
[0094] In another embodiment, selection on which one of the MVs or neither of the MVs being fixed is derived implicitly according to one or a combination of the selected reference pictures indices, temporal distance between the reference picture and the current picture, quantization parameter, the coded information of the current CU, prediction mode, motion vectors, motion vector resolution, residual of the current CU, and reference samples.
[0095] In another embodiment, which MV is fixed or neither of the MVs is explicitly signalled directly by the encoder.
[0096] In one embodiment, the BDOF motion displacement is derived using the traditional method. However, the derived motion displacement can be applied to MV0, MV1, or both MVs.
[0097] For example, the derived BDOF motion displacement (vx, vy) using traditional method can be applied to MV0 only, and the formula can be as follows P0 + P1+vx* (gradX0) + vy* (gradY0) .
[0098] In another embodiment, which MV is applied or both MVs can be implicitly derived or explicitly signalled.
[0099] In one embodiment, the BDOF motion displacement is derived with the POC distances between the current picture and two respective reference list considered. In traditional BDOF, the POC distances are assumed to be equal, and the derived motion displacement is applied to MV0 and MV1 with same magnitude. With the POC distances considered, the BDOF derived motion displacement can be applied to MV0 and MV1 with scaling factor pair (a, b) which is proportional to the POC distances. The equation can be as follows. P0 + P1+vx* (a*gradX0-b*gradX1) + vy* (a*gradY0-b*gradY1) .
[0100] Scheme 4: Same Sign of BDOF MV Refinements for L0 and L1
[0101] In one embodiment, BDOF can be applied under non-true-bi condition. In VVC, BDOF is disabled when both reference list0 and list1 are smaller or greater than the current picture in display order. To enable non-true-bi condition, the BDOF motion displacement can be applied to MV0 and MV1 with same sign. The equation can be as follows, P0 + P1+vx* (gradX0 + gradX1) + vy* (gradY0 + gradY1) .
[0102] In another embodiment, the POC distances between the current picture and two respective reference list are further considered. The equation can be as follows, where the scaling factor pair (a, b) is proportional to the POC distances. P0 + P1+vx* (a*gradX0 + b*gradX1) + vy* (a*gradY0 + b*gradY1) .
[0103] In another embodiment, one on / off control flag is signalled at CU level, slice level, picture level, and / or sequence level to indicate whether the proposed method in the above is enabled or not.
[0104] In another embodiment, the proposed method in the above is enabled or disabled according to one or a combination of the selected reference pictures indices, temporal distance between the reference picture and the current picture, quantization parameter, the coded information of current CU, prediction mode, motion vectors, motion vector resolution, residual of the current CU, and reference samples.
[0105] Scheme 5: BDOF Displacements Fusion
[0106] In one embodiment, the final displacement for a sample is the averaged displacement calculated by displacements of N samples within a region after sample-based displacements of a CU are derived.
[0107] For example, a sample is the centre of a region. The final displacement of the sample is obtained from averaging the derived sample-based displacements of all samples within the region.
[0108] For another example, a sample is included in a region regardless whether it is the centre of the region or not. The final displacement of the sample is obtained from averaging the derived sample-based displacements of all samples within the region.
[0109] In one embodiment, the final displacement for a sample is the weighted averaging displacement calculated by N samples’ displacements after sample-based displacements of a CU are derived.
[0110] For example, a sample is the centre of a region. Larger weighting values are for the samples which are closer to the centre of the region; smaller weighting values are for the samples which are farther from the centre of the region. The final displacement of the sample is obtained by weighted averaging the derived sample-based displacements of samples within the region.
[0111] For another example, a sample is included in a region whether it is the centre of the region or not. Larger weighting values are for the samples which are closer to the operating sample; smaller weighting values are for the samples which are farther from the operating sample. The final displacement of the operating sample is obtained by weighted averaging the derived sample-based displacements of samples within the region.
[0112] In one embodiment, the region size can be designed based on different criteria. For example, the region size is related to the CU size. A larger size of the region is given when the size of CU is larger; a smaller size of the region is given when the size of CU is smaller.
[0113] For another example, the region size is related to the prediction mode. When different prediction modes are selected, the region sizes can be different.
[0114] In another embodiment, one on / off control flag is signalled at CU level, slice level, picture level, and / or sequence level to indicate the proposed method in the above is enabled or not.
[0115] In another embodiment, the proposed method in the above is enabled or disabled according to one or a combination of the selected reference pictures indices, temporal distance between the reference picture and the current picture, quantization parameter, the coded information of the current CU, prediction mode, motion vectors, motion vector resolution, residual of the current CU, and reference samples.
[0116] Any of the foregoing proposed bi-directional prediction methods can be implemented in an inter / intra / prediction module of an encoder, and / or an inter / intra / prediction module of a decoder. For example, in the encoder side, the motion displacement pair derivation for bi-directional Optical Flow (BDOF) can be implemented as part of the Inter-Pred. unit 112 Fig. 1A. However, the encoder may also use additional processing unit to implement the required processing. For the decoder side, the required motion displacement pair derivation can be implemented as part of the MC unit 152 as shown in Fig. 1B. However, the decoder may also use additional processing unit to implement the required processing. Alternatively, any of the proposed methods can be implemented as a circuit coupled to the inter / intra / prediction module of the encoder and / or the inter / intra / prediction module of the decoder, so as to provide the information needed by the inter / intra / prediction module. While the Inter-Pred. 112 in the encoder side and MC 152 in the decoder side are shown as individual processing units, they may correspond to executable software or firmware codes stored on a media, such as hard disk or flash memory, for a CPU (Central Processing Unit) or programmable devices (e.g. DSP (Digital Signal Processor) or FPGA (Field Programmable Gate Array) ) .
[0117] Fig. 4 illustrates an exemplary flowchart of a video coding system using Bi-Directional Optical Flow (BDOF) to refine bi-direction predicted according to an embodiment of the present invention. The steps shown in the flowchart, as well as other flowcharts in this disclosure, may be implemented as program codes executable on one or more processors (e.g., one or more CPUs) at the encoder side and / or the decoder side. The steps shown in the flowchart may also be implemented based on hardware such as one or more electronic devices or processors arranged to perform the steps in the flowchart. According to this method, input data associated with a current block is received in step 410, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side. A first motion offset for a first predictor is determined based on a first reference picture and a second motion offset for a second predictor is determined based on a second reference picture separately by using a BDOF (Bi-Directional Optical Flow) motion model without a constraint for the first motion offset and the second motion offset to have a same magnitude in step 420, wherein the first motion offset is derived for a list 0 reference block and the second motion offset is derived for a list 1 reference block, wherein the first motion offset and the second motion offset are derived to minimize differences between the first predictor and the second predictor. A bi-directional prediction offset value corresponding to the linear combination of the first motion offset for the list 0 reference block and the second motion offset for the list 1 reference block is derived in step 430. A bidirectional predictor is determined for the current block based on the first predictor, the second predictor, and the bi-directional prediction offset value in step 440.
[0118] The flowchart shown above is 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.
[0119] 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.
[0120] 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.
[0121] 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
1.A method of video coding, the method comprising:receiving input data associated with a current block, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side;determining a first motion offset for a first predictor based on a first reference picture and a second motion offset for a second predictor based on a second reference picture separately by using a BDOF (Bi-Directional Optical Flow) motion model without a constraint for the first motion offset and the second motion offset to have a same magnitude, wherein the first motion offset is derived for a list 0 reference block and the second motion offset is derived for a list 1 reference block, wherein the first motion offset and the second motion offset are derived to minimize differences between the first predictor and the second predictor;determining a bi-directional prediction offset value corresponding to a linear combination of the first motion offset for the list 0 reference block and the second motion offset for the list 1 reference block; andderiving a bidirectional predictor for the current block based on the first predictor, the second predictor, and the bi-directional prediction offset value.2.The method of Claim 1, wherein a final predictor for the current block is derived by using a linear combination of a conventional predictor and the bidirectional prediction offset value.3.The method of Claim 1, wherein the first motion offset and the second motion offset are derived using Gaussian elimination.4.The method of Claim 1, wherein one or more regularization terms are added during said determining the first motion offset and the second motion offset to cause x-component of the first motion offset closer to - (x-component) of the second motion offset, y-component of the first motion offset closer to - (y-component) of the second motion offset, or both.5.The method of Claim 1, wherein the first motion offset and the second motion offset are derived by using an optical flow algorithm.6.The method of Claim 5, wherein after the first motion offset and the second motion offset are derived by using the optical flow algorithm, a new first motion offset and a new second motion offset are derived by using a regression method based on the first motion offset and the second motion offset.7.The method of Claim 6, wherein one or more regularization terms are added to constrain a motion offset difference between the first motion offset and the second motion offset and the new first and second motion offsets.8.The method of Claim 7, said one or more regularization terms are designed based on bit-depth of a current picture, a current coded mode, or QP of the current block.9.The method of Claim 1, wherein a sample difference between the first predictor and the second predictor is represented by an alternative form corresponding to a second linear combination of first alternative x-component and first alternative y-component of a first alternative motion offset, and second alternative x-component and second alternative y-component of a second alternative motion offset, wherein weights for the second linear combination correspond to first sum of a first x-gradient and a second x-gradient, second sum of a first y-gradient and a second y-gradient, a first difference between the first x-gradient and the second x-gradient, a second difference between the first y-gradient and the second y-gradient respectively, and wherein the first motion offset and the second motion offset are derived from the first alternative motion offset and the second alternative motion offset.10.The method of Claim 9, wherein a first x-component of the first motion offset corresponds to a third sum of the first alternative x-component of the first alternative motion offset and the second alternative x-component of the second alternative motion offset, a second x-component of the second motion offset corresponds to a third difference between the first alternative x-component of the first alternative motion offset and the second alternative x-component of the second alternative motion offset, a first y-component of the first motion offset corresponds to a fourth sum of the first alternative y-component of the first alternative motion offset and the second alternative y-component of the second alternative motion offset, and a second y-component of the second motion offset corresponds to a fourth difference between the first alternative y-component of the first alternative motion offset and the second alternative y-component of the second alternative motion offset.11.The method of Claim 9, wherein one or more regularization terms are added to constrain to cause the first alternative motion offset to be much larger than the second alternative motion offset.12.The method of Claim 9, wherein the second alternative motion offset is treated as a refinement of the first alternative motion offset.13.The method of Claim 9, wherein only if the first alternative motion offset is much larger than the second alternative motion offset, the first alternative motion offset and the second alternative motion offset are used to derive the first motion offset and the second motion offset.14.The method of Claim 13, wherein if the first alternative motion offset is not much larger than the second alternative motion offset, original bidirectional optical flow model is used to derive the first motion offset and the second motion offset, and the first motion offset and the second motion offset have a same magnitude.15.The method of Claim 9, wherein a first final motion offset and a second final motion offset are derived by using a weighted sum of the first alternative motion offset and the second alternative motion offset.16.An apparatus for video coding, the apparatus comprising one or more electronics or processors arranged to:receive input data associated with a current block, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side;determine a first motion offset for a first predictor based on a first reference picture and a second motion offset for a second predictor based on a second reference picture separately by using a BDOF (Bi-Directional Optical Flow) motion model without a constraint for the first motion offset and the second motion offset to have a same magnitude, wherein the first motion offset is derived for a list 0 reference block and the second motion offset is derived for a list 1 reference block, wherein the first motion offset and the second motion offset are derived to minimize differences between the first predictor and the second predictor;determine a bi-directional prediction offset value corresponding to the linear combination of the first motion offset for the list 0 reference block and the second motion offset for the list 1 reference block; andderive a bidirectional predictor for the current block based on the first predictor, the second predictor, and the bi-directional prediction offset value.