Cleans up code related to video packetization overhead.

Bug: webrtc:10155
Change-Id: Idc3aaa916e38a18e5ca9dc861587e96465915c64
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186660
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32312}
This commit is contained in:
Erik Språng
2020-10-04 11:51:22 +02:00
committed by Commit Bot
parent f67bb271c2
commit 3c65a2b5d4
4 changed files with 4 additions and 13 deletions

View File

@ -334,9 +334,6 @@ RtpVideoSender::RtpVideoSender(
: send_side_bwe_with_overhead_(absl::StartsWith(
field_trials_.Lookup("WebRTC-SendSideBwe-WithOverhead"),
"Enabled")),
account_for_packetization_overhead_(!absl::StartsWith(
field_trials_.Lookup("WebRTC-SubtractPacketizationOverhead"),
"Disabled")),
has_packet_feedback_(TransportSeqNumExtensionConfigured(rtp_config)),
use_deferred_fec_(!absl::StartsWith(
field_trials_.Lookup("WebRTC-DeferredFecGeneration"),
@ -786,16 +783,13 @@ void RtpVideoSender::OnBitrateUpdated(BitrateAllocationUpdate update,
// since |fec_allowed_| may be toggled back on at any moment.
}
uint32_t packetization_rate_bps = 0;
if (account_for_packetization_overhead_) {
// Subtract packetization overhead from the encoder target. If target rate
// is really low, cap the overhead at 50%. This also avoids the case where
// |encoder_target_rate_bps_| is 0 due to encoder pause event while the
// packetization rate is positive since packets are still flowing.
packetization_rate_bps =
std::min(GetPacketizationOverheadRate(), encoder_target_rate_bps_ / 2);
encoder_target_rate_bps_ -= packetization_rate_bps;
}
uint32_t packetization_rate_bps =
std::min(GetPacketizationOverheadRate(), encoder_target_rate_bps_ / 2);
encoder_target_rate_bps_ -= packetization_rate_bps;
loss_mask_vector_.clear();

View File

@ -171,7 +171,6 @@ class RtpVideoSender : public RtpVideoSenderInterface,
const FieldTrialBasedConfig field_trials_;
const bool send_side_bwe_with_overhead_;
const bool account_for_packetization_overhead_;
const bool has_packet_feedback_;
const bool use_deferred_fec_;

View File

@ -319,7 +319,6 @@ TEST_F(BandwidthEndToEndTest, ReportsSetEncoderRates) {
// test, due to the packetization overhead and encoder pushback.
webrtc::test::ScopedFieldTrials field_trials(
std::string(field_trial::GetFieldTrialString()) +
"WebRTC-SubtractPacketizationOverhead/Disabled/"
"WebRTC-VideoRateControl/bitrate_adjuster:false/");
class EncoderRateStatsTest : public test::EndToEndTest,
public test::FakeEncoder {

View File

@ -2936,10 +2936,9 @@ TEST_F(VideoSendStreamTest, ReconfigureBitratesSetsEncoderBitratesCorrectly) {
static const int kIncreasedStartBitrateKbps = 451;
static const int kIncreasedMaxBitrateKbps = 597;
// If these fields trial are on, we get lower bitrates than expected by this
// test, due to the packetization overhead and encoder pushback.
// test, due to encoder pushback.
webrtc::test::ScopedFieldTrials field_trials(
std::string(field_trial::GetFieldTrialString()) +
"WebRTC-SubtractPacketizationOverhead/Disabled/"
"WebRTC-VideoRateControl/bitrate_adjuster:false/");
class EncoderBitrateThresholdObserver : public test::SendTest,