Lines Matching defs:bwest_str

45     BwEstimatorstr*              bwest_str,
53 bwest_str->send_bw_avg = INIT_BN_EST_WB;
58 bwest_str->send_bw_avg = INIT_BN_EST_SWB;
67 bwest_str->prev_frame_length = INIT_FRAME_LEN_WB;
68 bwest_str->rec_bw_inv = 1.0f /
70 bwest_str->rec_bw = (int32_t)INIT_BN_EST_WB;
71 bwest_str->rec_bw_avg_Q = INIT_BN_EST_WB;
72 bwest_str->rec_bw_avg = INIT_BN_EST_WB + INIT_HDR_RATE_WB;
73 bwest_str->rec_header_rate = INIT_HDR_RATE_WB;
78 bwest_str->prev_frame_length = INIT_FRAME_LEN_SWB;
79 bwest_str->rec_bw_inv = 1.0f /
81 bwest_str->rec_bw = (int32_t)INIT_BN_EST_SWB;
82 bwest_str->rec_bw_avg_Q = INIT_BN_EST_SWB;
83 bwest_str->rec_bw_avg = INIT_BN_EST_SWB + INIT_HDR_RATE_SWB;
84 bwest_str->rec_header_rate = INIT_HDR_RATE_SWB;
89 bwest_str->prev_rec_rtp_number = 0;
90 bwest_str->prev_rec_arr_ts = 0;
91 bwest_str->prev_rec_send_ts = 0;
92 bwest_str->prev_rec_rtp_rate = 1.0f;
93 bwest_str->last_update_ts = 0;
94 bwest_str->last_reduction_ts = 0;
95 bwest_str->count_tot_updates_rec = -9;
96 bwest_str->rec_jitter = 10.0f;
97 bwest_str->rec_jitter_short_term = 0.0f;
98 bwest_str->rec_jitter_short_term_abs = 5.0f;
99 bwest_str->rec_max_delay = 10.0f;
100 bwest_str->rec_max_delay_avg_Q = 10.0f;
101 bwest_str->num_pkts_rec = 0;
103 bwest_str->send_max_delay_avg = 10.0f;
105 bwest_str->hsn_detect_rec = 0;
107 bwest_str->num_consec_rec_pkts_over_30k = 0;
109 bwest_str->hsn_detect_snd = 0;
111 bwest_str->num_consec_snt_pkts_over_30k = 0;
113 bwest_str->in_wait_period = 0;
115 bwest_str->change_to_WB = 0;
117 bwest_str->numConsecLatePkts = 0;
118 bwest_str->consecLatency = 0;
119 bwest_str->inWaitLatePkts = 0;
120 bwest_str->senderTimestamp = 0;
121 bwest_str->receiverTimestamp = 0;
135 BwEstimatorstr *bwest_str,
160 if ( frame_length != bwest_str->prev_frame_length )
162 bwest_str->rec_header_rate = (float)HEADER_SIZE * 8.0f *
169 bwest_str->rec_header_rate;
173 if (arr_ts < bwest_str->prev_rec_arr_ts)
175 bwest_str->prev_rec_arr_ts = arr_ts;
176 bwest_str->last_update_ts = arr_ts;
177 bwest_str->last_reduction_ts = arr_ts + 3*FS;
178 bwest_str->num_pkts_rec = 0;
181 bwest_str->prev_frame_length = frame_length;
184 bwest_str->prev_rec_rtp_rate = rec_rtp_rate;
187 bwest_str->prev_rec_rtp_number = rtp_number;
192 bwest_str->num_pkts_rec++;
195 if ( bwest_str->count_tot_updates_rec > 0 )
197 if(bwest_str->in_wait_period > 0 )
199 bwest_str->in_wait_period--;
202 bwest_str->inWaitLatePkts -= ((bwest_str->inWaitLatePkts > 0)? 1:0);
203 send_ts_diff = (float)(send_ts - bwest_str->prev_rec_send_ts);
210 if((uint32_t)(arr_ts - bwest_str->last_update_ts) *
218 bwest_str->last_update_ts) * 1000.0f /(float) FS) /
221 if(((float)bwest_str->num_pkts_rec/(float)num_pkts_expected) >
226 bwest_str->last_reduction_ts)*1000.0f/FS) );
230 bwest_str->rec_bw_inv /= inv_bitrate;
233 if (bwest_str->hsn_detect_snd &&
234 bwest_str->hsn_detect_rec)
236 if (bwest_str->rec_bw_inv > 0.000066f)
238 bwest_str->rec_bw_inv = 0.000066f;
244 bwest_str->rec_bw_inv = 1.0f /
248 bwest_str->last_reduction_ts = arr_ts;
253 bwest_str->last_reduction_ts = arr_ts + 3*FS;
254 bwest_str->last_update_ts = arr_ts;
255 bwest_str->num_pkts_rec = 0;
261 bwest_str->last_reduction_ts = arr_ts + 3*FS;
262 bwest_str->last_update_ts = arr_ts;
263 bwest_str->num_pkts_rec = 0;
268 if ( frame_length != bwest_str->prev_frame_length )
270 bwest_str->count_tot_updates_rec = 10;
271 bwest_str->rec_header_rate = (float)HEADER_SIZE * 8.0f *
274 bwest_str->rec_bw_inv = 1.0f /((float)bwest_str->rec_bw +
275 bwest_str->rec_header_rate);
279 arr_ts_diff = (float)(arr_ts - bwest_str->prev_rec_arr_ts);
290 if((late_diff > 0) && !bwest_str->inWaitLatePkts)
292 bwest_str->numConsecLatePkts++;
293 bwest_str->consecLatency += late_diff;
297 bwest_str->numConsecLatePkts = 0;
298 bwest_str->consecLatency = 0;
300 if(bwest_str->numConsecLatePkts > 50)
302 float latencyMs = bwest_str->consecLatency/(FS/1000);
303 float averageLatencyMs = latencyMs / bwest_str->numConsecLatePkts;
306 bwest_str->inWaitLatePkts = (int16_t)((bwest_str->consecLatency/(FS/1000)) / 30);// + 150;
307 bwest_str->start_wait_period = arr_ts;
314 if ( rtp_number == bwest_str->prev_rec_rtp_number + 1 )
318 if (!(bwest_str->hsn_detect_snd && bwest_str->hsn_detect_rec))
323 if ((late_diff > 8000.0f) && !bwest_str->in_wait_period)
326 bwest_str->in_wait_period = 55;
327 bwest_str->start_wait_period = arr_ts;
331 else if (late_diff > 5120.0f && !bwest_str->in_wait_period)
335 bwest_str->in_wait_period = 44;
336 bwest_str->start_wait_period = arr_ts;
342 if ((bwest_str->prev_rec_rtp_rate > bwest_str->rec_bw_avg) &&
343 (rec_rtp_rate > bwest_str->rec_bw_avg) &&
344 !bwest_str->in_wait_period)
347 if (bwest_str->count_tot_updates_rec++ > 99)
355 weight = 1.0f / (float) bwest_str->count_tot_updates_rec;
378 (1.0f / (MAX_ISAC_BW + bwest_str->rec_header_rate)))
382 (MAX_ISAC_BW + bwest_str->rec_header_rate));
386 bwest_str->rec_bw_inv = weight * curr_bw_inv +
387 (1.0f - weight) * bwest_str->rec_bw_inv;
390 bwest_str->last_update_ts = arr_ts;
391 bwest_str->last_reduction_ts = arr_ts + 3 * FS;
392 bwest_str->num_pkts_rec = 0;
397 1000.0f) / bwest_str->rec_bw_avg;
407 bwest_str->rec_jitter = weight * arr_time_noise_abs +
408 (1.0f - weight) * bwest_str->rec_jitter;
409 if (bwest_str->rec_jitter > 10.0f)
411 bwest_str->rec_jitter = 10.0f;
414 bwest_str->rec_jitter_short_term_abs = 0.05f *
416 bwest_str->rec_jitter_short_term_abs;
419 bwest_str->rec_jitter_short_term = 0.05f * arr_time_noise +
420 0.95f * bwest_str->rec_jitter_short_term;
428 bwest_str->last_update_ts = arr_ts;
429 bwest_str->last_reduction_ts = arr_ts + 3*FS;
430 bwest_str->num_pkts_rec = 0;
432 bwest_str->count_tot_updates_rec++;
436 if (bwest_str->rec_bw_inv > 1.0f / ((float)MIN_ISAC_BW +
437 bwest_str->rec_header_rate))
439 bwest_str->rec_bw_inv = 1.0f / ((float)MIN_ISAC_BW +
440 bwest_str->rec_header_rate);
444 if (bwest_str->rec_bw_inv < 1.0f / ((float)MAX_ISAC_BW +
445 bwest_str->rec_header_rate))
447 bwest_str->rec_bw_inv = 1.0f / ((float)MAX_ISAC_BW +
448 bwest_str->rec_header_rate);
452 bwest_str->prev_frame_length = frame_length;
455 bwest_str->prev_rec_rtp_rate = rec_rtp_rate;
458 bwest_str->prev_rec_rtp_number = rtp_number;
460 // Replace bwest_str->rec_max_delay by the new
462 bwest_str->rec_max_delay = 3.0f * bwest_str->rec_jitter;
465 bwest_str->prev_rec_arr_ts = arr_ts ;
466 bwest_str->prev_rec_send_ts = send_ts;
468 /* Replace bwest_str->rec_bw by the new value (atomic operation) */
469 bwest_str->rec_bw = (int32_t)(1.0f / bwest_str->rec_bw_inv -
470 bwest_str->rec_header_rate);
474 bwest_str->rec_bw = (int32_t) (delay_correction_factor *
475 (float) bwest_str->rec_bw);
477 if (bwest_str->rec_bw < (int32_t) MIN_ISAC_BW)
479 bwest_str->rec_bw = (int32_t) MIN_ISAC_BW;
482 bwest_str->rec_bw_avg = bwest_str->rec_bw +
483 bwest_str->rec_header_rate;
485 bwest_str->rec_bw_avg_Q = (float) bwest_str->rec_bw;
487 bwest_str->rec_jitter_short_term = 0.0f;
489 bwest_str->rec_bw_inv = 1.0f / (bwest_str->rec_bw +
490 bwest_str->rec_header_rate);
492 bwest_str->count_tot_updates_rec = 1;
495 bwest_str->consecLatency = 0;
496 bwest_str->numConsecLatePkts = 0;
507 BwEstimatorstr* bwest_str,
523 bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg +
529 bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg +
534 bwest_str->send_bw_avg = 0.9f * bwest_str->send_bw_avg +
540 bwest_str->send_bw_avg = 0.9f * bwest_str->send_bw_avg +
544 if (bwest_str->send_bw_avg > (float) 28000 && !bwest_str->hsn_detect_snd)
546 bwest_str->num_consec_snt_pkts_over_30k++;
548 if (bwest_str->num_consec_snt_pkts_over_30k >= 66)
551 bwest_str->hsn_detect_snd = 1;
554 else if (!bwest_str->hsn_detect_snd)
556 bwest_str->num_consec_snt_pkts_over_30k = 0;
564 BwEstimatorstr* bwest_str,
575 bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg +
581 bwest_str->send_max_delay_avg = 0.9f * bwest_str->send_max_delay_avg +
594 BwEstimatorstr* bwest_str,
614 MaxDelay = (float)WebRtcIsac_GetDownlinkMaxDelay(bwest_str);
616 if ( ((1.f - weight) * bwest_str->rec_max_delay_avg_Q + weight *
618 bwest_str->rec_max_delay_avg_Q - weight * MIN_ISAC_MD) )
622 bwest_str->rec_max_delay_avg_Q =
623 (1.f - weight) * bwest_str->rec_max_delay_avg_Q + weight *
630 bwest_str->rec_max_delay_avg_Q =
631 (1.f-weight) * bwest_str->rec_max_delay_avg_Q + weight *
636 rate = (float)WebRtcIsac_GetDownlinkBandwidth(bwest_str);
667 r = (1 - weight) * bwest_str->rec_bw_avg_Q - rate;
681 bwest_str->rec_bw_avg_Q = (1 - weight) * bwest_str->rec_bw_avg_Q +
685 bwest_str->rec_bw_avg = (1 - weight) * bwest_str->rec_bw_avg + weight *
686 (rate + bwest_str->rec_header_rate);
694 int32_t WebRtcIsac_GetDownlinkBandwidth( const BwEstimatorstr *bwest_str)
701 jitter_sign = bwest_str->rec_jitter_short_term /
702 bwest_str->rec_jitter_short_term_abs;
708 rec_bw = (int32_t)(bwest_str->rec_bw * bw_adjust);
724 WebRtcIsac_GetDownlinkMaxDelay(const BwEstimatorstr *bwest_str)
728 rec_max_delay = (int32_t)(bwest_str->rec_max_delay);
745 const BwEstimatorstr* bwest_str,
749 if (bwest_str->send_bw_avg < MIN_ISAC_BW)
753 else if (bwest_str->send_bw_avg > MAX_ISAC_BW)
759 *bitRate = (int32_t)(bwest_str->send_bw_avg);
766 WebRtcIsac_GetUplinkMaxDelay(const BwEstimatorstr *bwest_str)
770 send_max_delay = (int32_t)(bwest_str->send_max_delay_avg);