Webrtc delay-base-bwe代码分析(1): RateStatistics模块

本文深入分析WebRTC中delay-base-bwe的RateStatistics模块,该模块用于记录时间窗口内的传输速率,并计算当前区域的码率。主要内容包括RateStatistics的数据结构,如总统计值、时间窗口索引和参数设置。通过示例解释了如何处理时间窗口更新和新节点插入,帮助理解其工作原理。
摘要由CSDN通过智能技术生成

@(webrtc)[webrtc, congestion control]

Webrtc delay-base-bwe代码分析(1): RateStatistics模块

RateStatistics这个类的作用为记录一个时间窗口内的速率值,并返回当前时间区域内的码率值。单独开一个文章主要是用来描述其用来记录速率值的桶,一开始看的比较迷糊。

class RateStatistics {
  // Counters are kept in buckets (circular buffer), with one bucket
  // per millisecond.
  // 每毫秒一个记录值。
  struct Bucket {
    size_t sum;      // Sum of all samples in this bucket.
    size_t samples;  // Number of samples in this bucket.
  };
  std::unique_ptr<Bucket[]> buckets_;

  // 统计总值,一个为总的传输字节数,一个为这个单位时间内,总的采样点数。
  // Total count recorded in buckets.
  size_t accumulated_count_;

  // The total number of samples in the buckets.
  size_t num_samples_;

  // 某个采样时间内的时间起点。包括时间值和索引值。
  // Oldest time recorded in buckets.
  int64_t oldest_time_;

  // Bucket index of oldest counter recorded in buckets.
  uint32_t old
  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值