summaryrefslogtreecommitdiff
path: root/libavdevice/timefilter.h
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-02-15 19:15:45 +0100
committerNicolas George <nicolas.george@normalesup.org>2012-03-05 16:57:27 +0100
commit3073aadf2ded5f02f2db7ee151a02f592ea24733 (patch)
tree9362cec0db3e674132eb99822742fbcd27b154dc /libavdevice/timefilter.h
parent1007a805a486a1348a0543ac2dd99d823148d25c (diff)
timefilter: internally compute feedback factors.
The feedback factors for the timefilter are directly computed from the expected period. This commit changes the init function to accept the period itself and compute the feedback factors internally, rather than having all client code duplicate the formulas. This commit also actually fixes the formulas: the current code had sqrt(2*o), but the correct formula, both theoretically and according to experimental testing, is sqrt(2)*o. Furthermore, it adds an exponential to feedback factors larger than 1 with large periods.
Diffstat (limited to 'libavdevice/timefilter.h')
-rw-r--r--libavdevice/timefilter.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavdevice/timefilter.h b/libavdevice/timefilter.h
index 2a77946e99..33862f63bb 100644
--- a/libavdevice/timefilter.h
+++ b/libavdevice/timefilter.h
@@ -45,16 +45,18 @@ typedef struct TimeFilter TimeFilter;
*
* Unless you know what you are doing, you should set these as follow:
*
- * o = 2 * M_PI * bandwidth * period
- * feedback2_factor = sqrt(2 * o)
+ * o = 2 * M_PI * bandwidth * period_in_seconds
+ * feedback2_factor = sqrt(2) * o
* feedback3_factor = o * o
*
* Where bandwidth is up to you to choose. Smaller values will filter out more
* of the jitter, but also take a longer time for the loop to settle. A good
* starting point is something between 0.3 and 3 Hz.
*
- * @param clock_period period of the hardware clock in seconds
- * (for example 1.0/44100)
+ * @param time_base period of the hardware clock in seconds
+ * (for example 1.0/44100)
+ * @param period expected update interval, in input units
+ * @param brandwidth filtering bandwidth, in Hz
*
* For more details about these parameters and background concepts please see:
* http://www.kokkinizita.net/papers/usingdll.pdf