Skip to content

Commit

Permalink
Update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Mar 31, 2024
1 parent e77106a commit f424830
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/source/blog/opticalflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Source Code
const int Exponent = exp2(ExponentBits);
const int Significand = exp2(SignificandBits);
const float MaxExponent = (Exponent - exp2(1)) + Bias;
const float MaxExponent = ((float)Exponent - (float)exp2(1)) + (float)Bias;
const float MaxSignificand = 1.0 + (((float)Significand - 1.0) / (float)Significand);
return pow(-1, SignBit) * exp2(MaxExponent) * MaxSignificand;
return (float)pow(-1, SignBit) * (float)exp2(MaxExponent) * MaxSignificand;
}
// [-Half, Half] -> [-1.0, 1.0]
Expand Down Expand Up @@ -170,9 +170,12 @@ Source Code
// Calculate A^T*B
float2 Flow = (D == 0.0) ? 0.0 : mul(B, A);
// Propagate motion vectors to Half format
// Propagate normalized motion vectors
Vectors += NormalizeMotionVectors(Flow, PixelSize);
// Clamp motion vectors to restrict range to valid lengths
Vectors = clamp(Vectors, -1.0, 1.0);
// Pack motion vectors to Half format
return PackMotionVectors(Vectors);
}

0 comments on commit f424830

Please sign in to comment.