]> git.sesse.net Git - movit/blobdiff - resample_effect.cpp
Update a comment that wasn't really wrong, but less relevant in this context.
[movit] / resample_effect.cpp
index 5ea5fe4bd91f80f1d260c52baaeebbb63dabd7b7..f438a873b095114554bb1b53a41cebe263d16f4b 100644 (file)
@@ -266,7 +266,7 @@ double compute_sum_sq_error(const Tap<float>* weights, unsigned num_weights,
 //   sum(w_kj sum( d_i w_ij, i ), j) = sum(w_kj c_j, j)
 //
 // where again, we remember where the sums over j are over at most two elements,
-// since w_ij is nonzero for at most two values of j.
+// since w_kj is nonzero for at most two values of j.
 template<class T>
 void optimize_sum_sq_error(const Tap<float>* weights, unsigned num_weights,
                            Tap<T>* bilinear_weights, unsigned num_bilinear_weights,
@@ -293,18 +293,18 @@ void optimize_sum_sq_error(const Tap<float>* weights, unsigned num_weights,
        // notation in the derivation above.
        for (unsigned k = 0; k < num_bilinear_weights; ++k) {
                for (int j = pos[k]; j <= pos[k] + 1; ++j) {
-                       const float f_kj = (j == pos[k]) ? (1.0f - fracs[k]) : fracs[k];
+                       const float w_kj = (j == pos[k]) ? (1.0f - fracs[k]) : fracs[k];
                        for (unsigned i = 0; i < num_bilinear_weights; ++i) {
-                               float f_ij;
+                               float w_ij;
                                if (j == pos[i]) {
-                                       f_ij = 1.0f - fracs[i];
+                                       w_ij = 1.0f - fracs[i];
                                } else if (j == pos[i] + 1) {
-                                       f_ij = fracs[i];
+                                       w_ij = fracs[i];
                                } else {
-                                       // f_ij = 0
+                                       // w_ij = 0
                                        continue;
                                }
-                               A.coeffRef(i, k) += f_kj * f_ij;
+                               A.coeffRef(i, k) += w_kj * w_ij;
                        }
                        float c_j;
                        if (j >= c_lower_pos && j < c_upper_pos) {
@@ -312,7 +312,7 @@ void optimize_sum_sq_error(const Tap<float>* weights, unsigned num_weights,
                        } else {
                                c_j = 0.0f;
                        }
-                       b.coeffRef(k) += f_kj * c_j;
+                       b.coeffRef(k) += w_kj * c_j;
                }
        }
        delete[] pos;