]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] change estimator CUSUM design params for loss to reduce oscillations. rename...
authorDragos Oancea <dragos@signalwire.com>
Mon, 1 Jun 2020 11:41:36 +0000 (11:41 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:09 +0000 (22:00 +0300)
src/switch_estimators.c
src/switch_rtp.c

index 2aedf8cc6e878acb3788c9c2d06770af78e5a1f3..61552644b14cdeb5ed44d946523546e9bb81fc93 100644 (file)
@@ -139,7 +139,7 @@ SWITCH_DECLARE(switch_bool_t) switch_kalman_cusum_init(cusum_kalman_detector_t *
        return TRUE;
 }
 
-SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detector, float measurement, float rtt_avg)
+SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detector, float measurement, float avg)
 {
        float K=0;
        float P=0;
@@ -153,8 +153,8 @@ SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_de
 
        detector->N++;
        current_average = detector->last_average + (measurement - detector->last_average)/detector->N ;
-       if (rtt_avg > current_average) {
-               current_average = rtt_avg;
+       if (avg > current_average) {
+               current_average = avg;
        }
        current_q =  detector-> last_q +  (measurement - detector->last_average) * (measurement - current_average);
        if (detector->N != 0)
index 199c9e95f79f4f82c823ca4989261e5cf6d6ef4b..aa25ea1c7971f13e08561f227adef187955a1ecb 100644 (file)
@@ -1953,7 +1953,7 @@ static void rtcp_stats_init(switch_rtp_t *rtp_session)
                        rtp_session->detectors[EST_RTT] = switch_core_alloc(rtp_session->pool, sizeof(*detectors[0]));
                        switch_kalman_cusum_init(rtp_session->detectors[EST_RTT],0.005,0.5);
                        rtp_session->detectors[EST_LOSS] = switch_core_alloc(rtp_session->pool, sizeof(*detectors[0]));
-                       switch_kalman_cusum_init(rtp_session->detectors[EST_LOSS],0.005,0.5);
+                       switch_kalman_cusum_init(rtp_session->detectors[EST_LOSS], 0.5, 1);
        }
 }