Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc

Issue 3013613002: Added configurable offsets to the per-packet overhead in ANA. (Closed)
Patch Set: Set prev_direction_increase in the Frame length controller. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc
index 9fab78101077da866dbbc28a9310befc1fb7b868..07f7061fabc8a24a83c40e7b5355ca8916d7c5ec 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc
@@ -55,8 +55,8 @@ TEST(AnaBitrateControllerTest, OutputInitValueWhenTargetBitrateUnknown) {
constexpr int kInitialBitrateBps = 32000;
constexpr int kInitialFrameLengthMs = 20;
constexpr size_t kOverheadBytesPerPacket = 64;
- BitrateController controller(
- BitrateController::Config(kInitialBitrateBps, kInitialFrameLengthMs));
+ BitrateController controller(BitrateController::Config(
+ kInitialBitrateBps, kInitialFrameLengthMs, 0, 0));
ossu 2017/09/14 12:16:14 Will you be adding any tests for this functionalit
ivoc 2017/09/14 13:03:39 I'm not sure if tests are the best way to check th
UpdateNetworkMetrics(&controller, rtc::Optional<int>(),
rtc::Optional<size_t>(kOverheadBytesPerPacket));
CheckDecision(&controller, rtc::Optional<int>(kInitialFrameLengthMs * 2),
@@ -67,8 +67,8 @@ TEST(AnaBitrateControllerTest, OutputInitValueWhenOverheadUnknown) {
constexpr int kInitialBitrateBps = 32000;
constexpr int kInitialFrameLengthMs = 20;
constexpr int kTargetBitrateBps = 48000;
- BitrateController controller(
- BitrateController::Config(kInitialBitrateBps, kInitialFrameLengthMs));
+ BitrateController controller(BitrateController::Config(
+ kInitialBitrateBps, kInitialFrameLengthMs, 0, 0));
UpdateNetworkMetrics(&controller, rtc::Optional<int>(kTargetBitrateBps),
rtc::Optional<size_t>());
CheckDecision(&controller, rtc::Optional<int>(kInitialFrameLengthMs * 2),
@@ -80,7 +80,7 @@ TEST(AnaBitrateControllerTest, ChangeBitrateOnTargetBitrateChanged) {
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
constexpr int kInitialFrameLengthMs = 20;
BitrateController controller(
- BitrateController::Config(32000, kInitialFrameLengthMs));
+ BitrateController::Config(32000, kInitialFrameLengthMs, 0, 0));
constexpr int kTargetBitrateBps = 48000;
constexpr size_t kOverheadBytesPerPacket = 64;
constexpr int kBitrateBps =
@@ -106,7 +106,7 @@ TEST(AnaBitrateControllerTest, UpdateMultipleNetworkMetricsAtOnce) {
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
constexpr int kInitialFrameLengthMs = 20;
BitrateController controller(
- BitrateController::Config(32000, kInitialFrameLengthMs));
+ BitrateController::Config(32000, kInitialFrameLengthMs, 0, 0));
constexpr int kTargetBitrateBps = 48000;
constexpr size_t kOverheadBytesPerPacket = 64;
constexpr int kBitrateBps =
@@ -127,7 +127,7 @@ TEST(AnaBitrateControllerTest, TreatUnknownFrameLengthAsFrameLengthUnchanged) {
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
constexpr int kInitialFrameLengthMs = 20;
BitrateController controller(
- BitrateController::Config(32000, kInitialFrameLengthMs));
+ BitrateController::Config(32000, kInitialFrameLengthMs, 0, 0));
constexpr int kTargetBitrateBps = 48000;
constexpr size_t kOverheadBytesPerPacket = 64;
constexpr int kBitrateBps =
@@ -143,7 +143,7 @@ TEST(AnaBitrateControllerTest, IncreaseBitrateOnFrameLengthIncreased) {
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
constexpr int kInitialFrameLengthMs = 20;
BitrateController controller(
- BitrateController::Config(32000, kInitialFrameLengthMs));
+ BitrateController::Config(32000, kInitialFrameLengthMs, 0, 0));
constexpr int kTargetBitrateBps = 48000;
constexpr size_t kOverheadBytesPerPacket = 64;
@@ -169,7 +169,7 @@ TEST(AnaBitrateControllerTest, DecreaseBitrateOnFrameLengthDecreased) {
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
constexpr int kInitialFrameLengthMs = 60;
BitrateController controller(
- BitrateController::Config(32000, kInitialFrameLengthMs));
+ BitrateController::Config(32000, kInitialFrameLengthMs, 0, 0));
constexpr int kTargetBitrateBps = 48000;
constexpr size_t kOverheadBytesPerPacket = 64;
@@ -193,7 +193,7 @@ TEST(AnaBitrateControllerTest, DecreaseBitrateOnFrameLengthDecreased) {
TEST(AnaBitrateControllerTest, BitrateNeverBecomesNegative) {
test::ScopedFieldTrials override_field_trials(
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
- BitrateController controller(BitrateController::Config(32000, 20));
+ BitrateController controller(BitrateController::Config(32000, 20, 0, 0));
constexpr size_t kOverheadBytesPerPacket = 64;
constexpr int kFrameLengthMs = 60;
// Set a target rate smaller than overhead rate, the bitrate is bounded by 0.
@@ -207,7 +207,7 @@ TEST(AnaBitrateControllerTest, BitrateNeverBecomesNegative) {
TEST(AnaBitrateControllerTest, CheckBehaviorOnChangingCondition) {
test::ScopedFieldTrials override_field_trials(
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
- BitrateController controller(BitrateController::Config(32000, 20));
+ BitrateController controller(BitrateController::Config(32000, 20, 0, 0));
// Start from an arbitrary overall bitrate.
int overall_bitrate = 34567;

Powered by Google App Engine
This is Rietveld 408576698