当前位置: 首页 > news >正文

做seo网站不用域名手机访问另一部手机访问文件

做seo网站不用域名,手机访问另一部手机访问文件,网站开发 项目内容,项目推广方式一、背景介绍 一些报文在网络传输中,会存在丢包重传和延时的情况。渲染时需要进行适当缓存,等待丢失被重传的报文或者正在路上传输的报文。 jitter延时计算是确认需要缓存的时间 另外,在检测到帧有重传情况时,也可适当在渲染时…

一、背景介绍

一些报文在网络传输中,会存在丢包重传和延时的情况。渲染时需要进行适当缓存,等待丢失被重传的报文或者正在路上传输的报文。

jitter延时计算是确认需要缓存的时间

另外,在检测到帧有重传情况时,也可适当在渲染时间内增加RTT延时时间,等待丢失重传的报文

二、jitter实现原理

JitterDelay由两部分延迟造成:传输大帧引起的延迟和网络噪声引起的延迟。计算公式如下:

其中:

estimate[0]:信道传输速率的倒数
MaxFrameSize:表示自会话开始以来所收到的最大帧size
AvgFrameSize:表示平均帧大小,排除keyframe等超大帧

kNoiseStdDevs:       表示噪声系数2.33
var_noise_ms2_:     表示噪声方差
kNoiseStdDevOffset:  表示噪声扣除常数30 

实现函数:

JitterEstimator::CalculateEstimate

1、传输大帧引起的延迟

传输大帧引起的延迟

这个公式的原理是:[milliseconds] = [1 / bytes per millisecond] * [bytes] 

实现函数:

double FrameDelayVariationKalmanFilter::GetFrameDelayVariationEstimateSizeBased(double frame_size_variation_bytes) const {// Unit: [1 / bytes per millisecond] * [bytes] = [milliseconds].return estimate_[0] * frame_size_variation_bytes;
}

filtered_max_frame_size_bytes

=  std::max<double>(kPsi * max_frame_size_bytes_, frame_size.bytes());

constexpr double kPsi = 0.9999;

filtered_avg_frame_size_bytes

是每一帧的加权平均值,但是需要排除key frame这种超大帧

estimate_[0]参数计算

使用一个简化卡尔曼滤波算法,在处理帧延迟变化(frame_delay_variation_ms)的估计,考虑了帧大小变化(frame_size_variation_bytes)和最大帧大小(max_frame_size_bytes)作为输入参数。

void FrameDelayVariationKalmanFilter::PredictAndUpdate(double frame_delay_variation_ms,double frame_size_variation_bytes,double max_frame_size_bytes,double var_noise) {// Sanity checks.if (max_frame_size_bytes < 1) {return;}if (var_noise <= 0.0) {return;}// This member function follows the data flow in// https://en.wikipedia.org/wiki/Kalman_filter#Details.// 1) Estimate prediction: `x = F*x`.// For this model, there is no need to explicitly predict the estimate, since// the state transition matrix is the identity.// 2) Estimate covariance prediction: `P = F*P*F' + Q`.// Again, since the state transition matrix is the identity, this update// is performed by simply adding the process noise covariance.estimate_cov_[0][0] += process_noise_cov_diag_[0];estimate_cov_[1][1] += process_noise_cov_diag_[1];// 3) Innovation: `y = z - H*x`.// This is the part of the measurement that cannot be explained by the current// estimate.double innovation =frame_delay_variation_ms -GetFrameDelayVariationEstimateTotal(frame_size_variation_bytes);// 4) Innovation variance: `s = H*P*H' + r`.double estim_cov_times_obs[2];estim_cov_times_obs[0] =estimate_cov_[0][0] * frame_size_variation_bytes + estimate_cov_[0][1];estim_cov_times_obs[1] =estimate_cov_[1][0] * frame_size_variation_bytes + estimate_cov_[1][1];double observation_noise_stddev =(300.0 * exp(-fabs(frame_size_variation_bytes) /(1e0 * max_frame_size_bytes)) +1) *sqrt(var_noise);if (observation_noise_stddev < 1.0) {observation_noise_stddev = 1.0;}// TODO(brandtr): Shouldn't we add observation_noise_stddev^2 here? Otherwise,// the dimensional analysis fails.double innovation_var = frame_size_variation_bytes * estim_cov_times_obs[0] +estim_cov_times_obs[1] + observation_noise_stddev;if ((innovation_var < 1e-9 && innovation_var >= 0) ||(innovation_var > -1e-9 && innovation_var <= 0)) {RTC_DCHECK_NOTREACHED();return;}// 5) Optimal Kalman gain: `K = P*H'/s`.// How much to trust the model vs. how much to trust the measurement.double kalman_gain[2];kalman_gain[0] = estim_cov_times_obs[0] / innovation_var;kalman_gain[1] = estim_cov_times_obs[1] / innovation_var;// 6) Estimate update: `x = x + K*y`.// Optimally weight the new information in the innovation and add it to the// old estimate.estimate_[0] += kalman_gain[0] * innovation;estimate_[1] += kalman_gain[1] * innovation;// (This clamping is not part of the linear Kalman filter.)if (estimate_[0] < kMaxBandwidth) {estimate_[0] = kMaxBandwidth;}// 7) Estimate covariance update: `P = (I - K*H)*P`double t00 = estimate_cov_[0][0];double t01 = estimate_cov_[0][1];estimate_cov_[0][0] =(1 - kalman_gain[0] * frame_size_variation_bytes) * t00 -kalman_gain[0] * estimate_cov_[1][0];estimate_cov_[0][1] =(1 - kalman_gain[0] * frame_size_variation_bytes) * t01 -kalman_gain[0] * estimate_cov_[1][1];estimate_cov_[1][0] = estimate_cov_[1][0] * (1 - kalman_gain[1]) -kalman_gain[1] * frame_size_variation_bytes * t00;estimate_cov_[1][1] = estimate_cov_[1][1] * (1 - kalman_gain[1]) -kalman_gain[1] * frame_size_variation_bytes * t01;// Covariance matrix, must be positive semi-definite.RTC_DCHECK(estimate_cov_[0][0] + estimate_cov_[1][1] >= 0 &&estimate_cov_[0][0] * estimate_cov_[1][1] -estimate_cov_[0][1] * estimate_cov_[1][0] >=0 &&estimate_cov_[0][0] >= 0);
}

2、网络噪声引起的延迟

网络噪声引起的延迟

constexpr double kNoiseStdDevs = 2.33; //噪声系数

constexpr double kNoiseStdDevOffset = 30.0;//噪声扣除常数

var_noise_ms2_ //噪声方差

实现函数:

噪声方差var_noise_ms2计算

var_noise_ms2 = alpha * var_noise_ms2_ + 
                (1 - alpha) *(d_dT - avg_noise_ms_) *(d_dT - avg_noise_ms_);

实现函数:JitterEstimator::EstimateRandomJitter

其中:

d_dT = 实际FrameDelay - 评估FrameDelay

             在JitterEstimator::UpdateEstimate函数实现

             

实际FrameDelay = (两帧之间实际接收gap - 两帧之间实际发送gap)

             在InterFrameDelayVariationCalculator::Calculate函数实现

absl::optional<TimeDelta> InterFrameDelayVariationCalculator::Calculate(uint32_t rtp_timestamp,Timestamp now) {int64_t rtp_timestamp_unwrapped = unwrapper_.Unwrap(rtp_timestamp);if (!prev_wall_clock_) {prev_wall_clock_ = now;prev_rtp_timestamp_unwrapped_ = rtp_timestamp_unwrapped;// Inter-frame delay variation is undefined for a single frame.// TODO(brandtr): Should this return absl::nullopt instead?return TimeDelta::Zero();}// Account for reordering in jitter variance estimate in the future?// Note that this also captures incomplete frames which are grabbed for// decoding after a later frame has been complete, i.e. real packet losses.uint32_t cropped_prev = static_cast<uint32_t>(prev_rtp_timestamp_unwrapped_);if (rtp_timestamp_unwrapped < prev_rtp_timestamp_unwrapped_ ||!IsNewerTimestamp(rtp_timestamp, cropped_prev)) {return absl::nullopt;}// Compute the compensated timestamp difference.TimeDelta delta_wall = now - *prev_wall_clock_;int64_t d_rtp_ticks = rtp_timestamp_unwrapped - prev_rtp_timestamp_unwrapped_;TimeDelta delta_rtp = d_rtp_ticks / k90kHz;// The inter-frame delay variation is the second order difference between the// RTP and wall clocks of the two frames, or in other words, the first order// difference between `delta_rtp` and `delta_wall`.TimeDelta inter_frame_delay_variation = delta_wall - delta_rtp;prev_wall_clock_ = now;prev_rtp_timestamp_unwrapped_ = rtp_timestamp_unwrapped;return inter_frame_delay_variation;
}

评估FrameDelay =  estimate[0] * (FrameSize – PreFrameSize) + estimate[1]

评估FrameDelay实现函数:

double FrameDelayVariationKalmanFilter::GetFrameDelayVariationEstimateTotal(double frame_size_variation_bytes) const {double frame_transmission_delay_ms =GetFrameDelayVariationEstimateSizeBased(frame_size_variation_bytes);double link_queuing_delay_ms = estimate_[1];return frame_transmission_delay_ms + link_queuing_delay_ms;
}

3、jitter延时更新流程

三、RTT延时计算 

VideoStreamBufferController::OnFrameReady函数,在判断帧有重传情况时,还会根据实际情况,在渲染帧时间里面增加RTT值。

JitterEstimator::GetJitterEstimate根据实际配置,可以在渲染时间中适当增加一定比例的RTT延时值。 

 

四、参考

WebRTC视频接收缓冲区基于KalmanFilter的延迟模型 - 简书在WebRTC的视频处理流水线中,接收端缓冲区JitterBuffer是关键的组成部分:它负责RTP数据包乱序重排和组帧,RTP丢包重传,请求重传关键帧,估算缓冲区延迟等功能...icon-default.png?t=N7T8https://www.jianshu.com/p/bb34995c549a

http://www.khdw.cn/news/36475.html

相关文章:

  • 云南旅游网站google引擎免费入口
  • 响应式网站是什么网站查询入口
  • 网站建设介绍刷推广链接人数的软件
  • 专门做网上链接推广的网站长春最专业的seo公司
  • 深圳做网站要二十个优化
  • 自己做网站前期困难吗seo如何去做优化
  • 网站建设与维护实训报告seo经验是什么
  • 在什么平台可以接外包客服成都网站优化排名
  • 深圳考试培训网站建设销售的三个核心点
  • wordpress修改页面title重庆企业站seo
  • 网站建设 技术 哪些方面目前最火的推广平台
  • 做商城网站可以个人备案竞价推广方案
  • 个人备案的网站做企业内容社区营销推广活动方案
  • 搜搜网站提交百度链接提交
  • 起网络公司名字大全seo外链增加
  • 金馆长做图网站百度推广账户登录
  • 计算机毕设网站代做谷歌搜索引擎首页
  • 淘宝做网站可靠吗it培训机构靠谱吗
  • 网站排名优化策划深圳网站优化推广方案
  • 中国做外贸网站有哪些上海搜索引擎优化公司
  • 如何手机创建网站手机百度关键词优化
  • 瓯海网站建设教师遭网课入侵直播录屏曝光广场舞
  • 中介做网站的别打电话太原百度公司地址
  • 做网站平台应该注意哪些搜索引擎优化入门
  • 成都网站建设定培训学校机构
  • 3g医院网站模板网址查询ip地址
  • wordpress小说站主题seo新手教程
  • 南京专业网站制作公司广州seo优化外包服务
  • 建站公司哪家好都选万维科技推广项目网站
  • 网站建设招标公告百度招聘网最新招聘信息