mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
clock: Make linear regression x/y base start from maximum observation.
Project the results of the linear regression to the end of the regression range, so they're more directly comparable to results going forward
This commit is contained in:
parent
08167e3234
commit
9d2b2768e3
1 changed files with 5 additions and 2 deletions
|
@ -217,8 +217,11 @@ _priv_gst_do_linear_regression (GstClockTime * times, guint n,
|
|||
|
||||
*m_num = sxy;
|
||||
*m_denom = sxx;
|
||||
*xbase = xmin;
|
||||
*b = (ybar + ymin) - gst_util_uint64_scale (xbar, *m_num, *m_denom);
|
||||
*b = (ymin + ybar) - gst_util_uint64_scale (xbar, *m_num, *m_denom);
|
||||
/* Report base starting from the most recent observation */
|
||||
*xbase = xmax;
|
||||
*b += gst_util_uint64_scale (xmax - xmin, *m_num, *m_denom);
|
||||
|
||||
*r_squared = ((double) sxy * (double) sxy) / ((double) sxx * (double) syy);
|
||||
|
||||
#ifdef DEBUGGING_ENABLED
|
||||
|
|
Loading…
Reference in a new issue