Chromium Code Reviews| Index: webrtc/voice_engine/channel.cc |
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
| index f3021fef6fec31f8e727fa3698158628dc1d89ee..93b129eeba79c478d6893d44ba0c559f1cfc0080 100644 |
| --- a/webrtc/voice_engine/channel.cc |
| +++ b/webrtc/voice_engine/channel.cc |
| @@ -1304,7 +1304,7 @@ int32_t Channel::SetSendCodec(const CodecInst& codec) { |
| return 0; |
| } |
| -void Channel::SetBitRate(int bitrate_bps) { |
| +void Channel::SetBitRate(int bitrate_bps, int probing_interval_ms) { |
| WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| "Channel::SetBitRate(bitrate_bps=%d)", bitrate_bps); |
| audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) { |
| @@ -1315,10 +1315,9 @@ void Channel::SetBitRate(int bitrate_bps) { |
| // We give smoothed bitrate allocation to audio network adaptor as |
| // the uplink bandwidth. |
| - // TODO(michaelt) : Remove kDefaultBitrateSmoothingTimeConstantMs as soon as |
| - // we pass the probing interval to this function. |
| - constexpr int64_t kDefaultBitrateSmoothingTimeConstantMs = 20000; |
| - bitrate_smoother_.SetTimeConstantMs(kDefaultBitrateSmoothingTimeConstantMs); |
| + // The probing spikes should not affect the bitrate smoother more than 25%. |
| + // 0.22 = 1 - e^(-t/probing_interval * 4) | t = probing_interval. |
|
stefan-webrtc
2016/11/22 16:39:05
This comment needs to be expanded, as I don't unde
michaelt
2016/11/23 12:28:29
Yes. I tried to to show how the filter would react
minyue-webrtc
2016/11/28 12:38:20
It may be clearer to say something like the follow
michaelt
2016/11/28 13:03:37
Done according to offline discussion.
|
| + bitrate_smoother_.SetTimeConstantMs(probing_interval_ms * 4); |
| bitrate_smoother_.AddSample(bitrate_bps); |
| audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) { |
| if (*encoder) { |