From 3dd0ce91bed63c39722b53dee45c1ddbc306e289 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 30 Apr 2017 19:35:26 +0200 Subject: filter/accela: reduce microstutter Discussed-with: @mrsanchos --- filter-accela/accela-settings.hpp | 19 +++++++++---------- filter-accela/ftnoir_accela_filtercontrols.ui | 2 +- filter-accela/ftnoir_filter_accela.cpp | 4 +--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp index c8357144..e23efdfe 100644 --- a/filter-accela/accela-settings.hpp +++ b/filter-accela/accela-settings.hpp @@ -8,15 +8,14 @@ struct settings_accela : opts { static constexpr double rot_gains[16][2] = { - { 12, 500 }, - { 11, 450 }, - { 10, 400 }, - { 9, 350 }, - { 8, 300 }, - { 7, 250 }, - { 6, 200 }, - { 2.66, 50 }, - { 1.66, 17 }, + { 8, 700 }, + { 7, 300 }, + { 6, 160 }, + { 5, 95 }, + + { 4, 55 }, + { 3, 25 }, + { 1.66, 10 }, { 1, 4 }, { .5, .53 }, { 0, 0 }, @@ -51,7 +50,7 @@ struct settings_accela : opts pos_sensitivity(b, "translation-sensitivity", slider_value(1., .05, 1.5)), rot_deadzone(b, "rotation-deadzone", slider_value(.03, 0, .1)), pos_deadzone(b, "translation-deadzone", slider_value(.1, 0, 1)), - ewma(b, "ewma", slider_value(0, 0, 300)), + ewma(b, "ewma", slider_value(0, 0, 200)), rot_nonlinearity(b, "rotation-nonlinearity", slider_value(1.2, 1, 1.3)) {} }; diff --git a/filter-accela/ftnoir_accela_filtercontrols.ui b/filter-accela/ftnoir_accela_filtercontrols.ui index a7720f44..9d4de296 100644 --- a/filter-accela/ftnoir_accela_filtercontrols.ui +++ b/filter-accela/ftnoir_accela_filtercontrols.ui @@ -80,7 +80,7 @@ 0 - 6 + 8 5 diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index 8d14361d..3f78c7a6 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -43,9 +43,7 @@ static void do_deltas(const double* deltas, double* output, double alpha, double return sqrt(ret); ); - const double dist = fmin(dist_, alpha*dist_ + (1-alpha)*smoothed); - smoothed = dist; - + const double dist = smoothed = fmin(dist_, alpha*dist_ + (1-alpha)*smoothed); const double value = double(fun(dist)); for (unsigned k = 0; k < N; k++) -- cgit v1.2.3