diff options
author | Jean-Luc Brouillet <jeanluc@google.com> | 2014-04-30 13:48:03 -0700 |
---|---|---|
committer | Jean-Luc Brouillet <jeanluc@google.com> | 2014-04-30 13:48:03 -0700 |
commit | 8b7117dfbcca8a74dfd83aaff7f82d2d7e3abd8f (patch) | |
tree | 63866f5d6c7c43e5c6461c170fe1bcfd1f28e90c /cpu_ref/rsCpuIntrinsicBlur.cpp | |
parent | 2535dfcad8cd48f8d9bde76b9ae30961d0489d34 (diff) | |
download | rs-8b7117dfbcca8a74dfd83aaff7f82d2d7e3abd8f.tar.gz |
Fix comments in gaussian blur
Change-Id: Ifae435f9b2e65d6064412d09558b0c6ea32aea25
Diffstat (limited to 'cpu_ref/rsCpuIntrinsicBlur.cpp')
-rw-r--r-- | cpu_ref/rsCpuIntrinsicBlur.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cpu_ref/rsCpuIntrinsicBlur.cpp b/cpu_ref/rsCpuIntrinsicBlur.cpp index 91302ed1..4e2ee969 100644 --- a/cpu_ref/rsCpuIntrinsicBlur.cpp +++ b/cpu_ref/rsCpuIntrinsicBlur.cpp @@ -63,12 +63,13 @@ void RsdCpuScriptIntrinsicBlur::ComputeGaussianWeights() { // Compute gaussian weights for the blur // e is the euler's number + // TODO Define these constants only once float e = 2.718281828459045f; float pi = 3.1415926535897932f; - // g(x) = ( 1 / sqrt( 2 * pi ) * sigma) * e ^ ( -x^2 / 2 * sigma^2 ) + // g(x) = (1 / (sqrt(2 * pi) * sigma)) * e ^ (-x^2 / (2 * sigma^2)) // x is of the form [-radius .. 0 .. radius] - // and sigma varies with radius. - // Based on some experimental radius values and sigma's + // and sigma varies with the radius. + // Based on some experimental radius values and sigmas, // we approximately fit sigma = f(radius) as // sigma = radius * 0.4 + 0.6 // The larger the radius gets, the more our gaussian blur @@ -91,7 +92,7 @@ void RsdCpuScriptIntrinsicBlur::ComputeGaussianWeights() { normalizeFactor += mFp[r + mIradius]; } - //Now we need to normalize the weights because all our coefficients need to add up to one + // Now we need to normalize the weights because all our coefficients need to add up to one normalizeFactor = 1.0f / normalizeFactor; for (r = -mIradius; r <= mIradius; r ++) { mFp[r + mIradius] *= normalizeFactor; |