算法思想
loss_based_bwe_v2 中对丢包情况的联合概率分布进行建模,其中包括两个参数inherent_loss和loss_limited_bandwidth,在计算过程中先固定loss_limited_bandwidth,然后通过最大化联合概率函数来更新inherent_loss(二阶牛顿方法更新,非梯度下降方法)。
当然我们注意到算法本身不是为了计算inherent_loss的,而是估计合适的loss_limited_bandwidth。LossBasedBweV2::UpdateBandwidthEstimate函数中有一组候选的loss_limited_bandwidth,和上面描述的一样,每次先固定loss_limited_bandwidth,然后更新inherent_loss(这里所有候选者对应的inherent_loss的初始值均为current_estimate_.inherent_loss),在更新完inherent_loss后,则会计算目标函数,使目标函数最大的loss_limited_bandwidth、inherent_loss则是当前的最终结果,记录在current_estimate_中。
算法细节
每个包丢包的概率为 GetLossProbability()结果,里面将丢包原因分为两部分,其一是inherent其二是超带宽,observations_[]中为从tcc中得到的统计信息,对应我们要处理的样本集合,样本中包含丢包数 num_lost_packets ,收包数 num_received_packets。其联合概率为:
$$J(loss\_pro) = \prod_i{loss\_{pro}^{N\_{loss}(i)}(1-loss\_{p