From 3c65a2b5d45c2c38a1641e49ef14e3f7830754cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Sun, 4 Oct 2020 11:51:22 +0200 Subject: [PATCH] Cleans up code related to video packetization overhead. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:10155 Change-Id: Idc3aaa916e38a18e5ca9dc861587e96465915c64 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186660 Reviewed-by: Sebastian Jansson Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/master@{#32312} --- call/rtp_video_sender.cc | 12 +++--------- call/rtp_video_sender.h | 1 - video/end_to_end_tests/bandwidth_tests.cc | 1 - video/video_send_stream_tests.cc | 3 +-- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc index aa53ff89a3..56c23d905f 100644 --- a/call/rtp_video_sender.cc +++ b/call/rtp_video_sender.cc @@ -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(); diff --git a/call/rtp_video_sender.h b/call/rtp_video_sender.h index 33dd5b744a..5eaaa29f2d 100644 --- a/call/rtp_video_sender.h +++ b/call/rtp_video_sender.h @@ -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_; diff --git a/video/end_to_end_tests/bandwidth_tests.cc b/video/end_to_end_tests/bandwidth_tests.cc index 6428207e62..721738393b 100644 --- a/video/end_to_end_tests/bandwidth_tests.cc +++ b/video/end_to_end_tests/bandwidth_tests.cc @@ -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 { diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc index 24795bb2cd..02e8b2bd7f 100644 --- a/video/video_send_stream_tests.cc +++ b/video/video_send_stream_tests.cc @@ -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,