From 2cd7e178e433149597a82a37f06e908a53860043 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 30 Sep 2015 16:22:51 +0200 Subject: accela: higher gain at small deltas --- ftnoir_filter_accela/ftnoir_filter_accela.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ftnoir_filter_accela') diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp index b9f7434f..b246a925 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp @@ -15,9 +15,9 @@ static constexpr double rot_gains[][2] = { { 2.66, 105 }, { 2.0, 47 }, { 1.66, 25 }, - { 1.33, 12 }, + { 1.33, 11 }, { 1, 3.5 }, - { .66, 1 }, + { .66, 1.4 }, { .33, .4 }, { 0, 0 }, { -1, 0 } -- cgit v1.2.3 From d626a60eca7a511786435ec796d7864c59463939 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 1 Oct 2015 07:48:53 +0200 Subject: accela: guard against negative value overflow properly Accela attempted to guard against both negative and positive value overstepping the last value due to gain, but the check for negative values was incorrect. Issue: #231 Reported-by: @nanospork, @alterscape, @SgtGrumbles --- ftnoir_filter_accela/ftnoir_filter_accela.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftnoir_filter_accela') diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp index b246a925..7f1d9d0a 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp @@ -97,7 +97,7 @@ void FTNoIR_Filter::filter(const double* input, double *output) const double thres = i >= 3 ? rot_t : trans_t; const double val = m.getValue(vec_ / thres); const double result = last_output[i] + (vec < 0 ? -1 : 1) * dt * val; - const bool negp = vec < 0.; + const bool negp = in < 0.; const bool done = negp ? result <= in : result >= in; -- cgit v1.2.3