summaryrefslogtreecommitdiff
path: root/include/ptrveloc.h
diff options
context:
space:
mode:
authorSimon Thum <simon.thum@gmx.de>2008-07-23 11:49:36 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-28 18:13:19 +0930
commit1a9f9ac50f2b0db735789905cc29572a50c8ae4c (patch)
treecce728d4ae9d01f5984af3bcfef471fdf5d0a097 /include/ptrveloc.h
parentc184b91d9aa72031c2bac9f379f56633957ded30 (diff)
dix: optimize precision in device velocity estimation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include/ptrveloc.h')
-rw-r--r--include/ptrveloc.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 8e56e4d47..2d42dda29 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -27,6 +27,9 @@
#include <input.h> /* DeviceIntPtr */
+/* maximum number of filters to approximate velocity.
+ * ABI-breaker!
+ */
#define MAX_VELOCITY_FILTERS 8
/* constants for acceleration profiles;
@@ -53,7 +56,7 @@ typedef float (*PointerAccelerationProfileFunc)
float /*threshold*/, float /*acc*/);
/**
- * a filter stage contains the data for the adaptive IIR filtering.
+ * a filter stage contains the data for adaptive IIR filtering.
* To improve results, one may run several parallel filters
* which have different decays. Since more integration means more
* delay, a given filter only does good matches in a specific phase of
@@ -77,7 +80,8 @@ typedef struct _DeviceVelocityRec {
float velocity; /* velocity as guessed by algorithm */
int lrm_time; /* time the last motion event was processed */
int last_dx, last_dy; /* last motion delta */
- int last_diff; /* last time-diff */
+ int last_diff; /* last time-difference */
+ Bool last_reset; /* whether a nv-reset occurred just before */
float corr_mul; /* config: multiply this into velocity */
float const_acceleration; /* config: (recipr.) const deceleration */
float min_acceleration; /* config: minimum acceleration */
@@ -89,7 +93,7 @@ typedef struct _DeviceVelocityRec {
void* profile_private;/* extended data, see SetAccelerationProfile() */
struct { /* to be able to query this information */
int profile_number;
- int filter_usecount[MAX_VELOCITY_FILTERS];
+ int filter_usecount[MAX_VELOCITY_FILTERS +1];
} statistics;
} DeviceVelocityRec, *DeviceVelocityPtr;