Patent ID: 11968387
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
Field: Audio-visual technology (Electrical engineering)
Classification: CPC H | IPC H

Claim 7:
8. An apparatus for predicting bidirectional optical flowing, comprising:
one or more processors; and
a non-transitory computer-readable storage medium coupled to the one or more processors and storing programming instructions for execution by the one or more processors, wherein the one or more processors, upon executing the programming instructions, cause the apparatus to carry out operations of
obtaining an initial motion vector pair for a current block, wherein the initial motion vector pair comprises a forward motion vector and a backward motion vector;
obtaining a forward prediction block according to the forward motion vector and a backward prediction block according to the backward motion vector;
calculating gradient parameters comprising a forward horizontal gradient, a backward horizontal gradient, a forward vertical gradient and a backward vertical gradient for a current sample in the current block based on a forward prediction sample and a backward prediction sample corresponding to the current sample, wherein the forward prediction sample is in the forward prediction block and the backward prediction sample is in the backward prediction block, and the forward prediction sample is represented by predSamplesL0[x][y] and the backward prediction sample is represented by predSamplesL1[x][y], the forward horizontal gradient is represented by gradientHL0[x][y], the backward horizontal gradient is represented by gradientHL1[x][y], the forward vertical gradient is represented by gradientVL0[x][y], and the backward vertical gradient is represented by gradientVL1[x][y];

obtaining at least two sample optical flow parameters for the current sample based on the gradient parameters, wherein the sample optical flow parameters comprises a first parameter and a second parameter;
obtaining block optical flow parameters based on sample optical flow parameters of samples in the current block, wherein one of the block optical flow parameters is obtained by an operation including multiplying a value of the first parameter and a value of a sign function of the second parameter, and wherein the sign function is a piecewise function with at least three subintervals; and
obtaining a prediction value of the current block based on the forward prediction block, the backward prediction block, the block optical flow parameters and the sample optical flow parameters, wherein the sample optical flow parameters comprise a sample difference, a horizontal average gradient and a vertical average gradient, wherein
the sample difference is represented by: diff[x][y]=predSamplesL0[x][y]−predSamplesL1[x][y];
the horizontal average gradient is represented by: TempH[x][y] =(gradientHL0[x][y]+gradientHL1[x][y]/2;
the vertical average gradient is represented by: TempV[x][y]=(gradientVL0[x][y]+gradient VL1[x][y])/2; and

wherein the first parameter is the horizontal average gradient, and the second parameter is the vertical average gradient, and wherein the sign function is, Sign
   (
   x
   )
  
  =
  
   {
   
    
     
      
       1
       ;
      
     
     
      
       x
       >
       T
      
     
    
    
     
      
       0
       ;
      
     
     
      
       
        -
        T
       
       ⩽
       x
       ⩽
       T
      
     
    
    
     
      
       
        -
        1
       
       ;
      
     
     
      
       x
       <
       
        -
        T, wherein T is a non-negative real number.