summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2023-03-16 13:30:01 -0700
committerWan-Teh Chang <wtc@google.com>2023-03-16 19:55:41 -0700
commit430c6c1553df0abfe2dadc480b21dd691a98140f (patch)
treea6e1179ddca3aa25b8813cf5d0c1cf4daffce839 /test
parentaf63e319789a26fe5d2c63a0da227cb03aff6f8f (diff)
downloadlibvpx-430c6c1553df0abfe2dadc480b21dd691a98140f.tar.gz
Change UpdateRateControl() to return bool
Change the VP9RateControlRtcConfig constructor to initialize ss_number_layers (to 1). Change UpdateRateControl() to return bool so that it can report failure (due to invalid configuration). Also change InitRateControl() to return bool to propagate the return value of UpdateRateControl(). Note: This is a port of the libaom CL https://aomedia-review.googlesource.com/c/aom/+/172042. Change-Id: I90b60353b5f15692dba5d89e7b1a9c81bb2fdd89
Diffstat (limited to 'test')
-rw-r--r--test/vp8_ratectrl_rtc_test.cc8
-rw-r--r--test/vp9_ratectrl_rtc_test.cc6
2 files changed, 7 insertions, 7 deletions
diff --git a/test/vp8_ratectrl_rtc_test.cc b/test/vp8_ratectrl_rtc_test.cc
index 56c26a99f..b76bcae11 100644
--- a/test/vp8_ratectrl_rtc_test.cc
+++ b/test/vp8_ratectrl_rtc_test.cc
@@ -160,7 +160,7 @@ class Vp8RcInterfaceTest
if (test_video_.width == 640 && target_bitrate_ == 1000) return;
SetConfig();
rc_api_ = libvpx::VP8RateControlRTC::Create(rc_cfg_);
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
::libvpx_test::I420VideoSource video(test_video_.name, test_video_.width,
test_video_.height, 30, 1, 0,
@@ -177,7 +177,7 @@ class Vp8RcInterfaceTest
key_interval_ = 100;
SetConfig();
rc_api_ = libvpx::VP8RateControlRTC::Create(rc_cfg_);
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
::libvpx_test::I420VideoSource video(test_video_.name, test_video_.width,
test_video_.height, 30, 1, 0,
@@ -193,7 +193,7 @@ class Vp8RcInterfaceTest
if (test_video_.width == 640 && target_bitrate_ == 1000) return;
SetConfigTemporalLayers(2);
rc_api_ = libvpx::VP8RateControlRTC::Create(rc_cfg_);
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
::libvpx_test::I420VideoSource video(test_video_.name, test_video_.width,
test_video_.height, 30, 1, 0,
@@ -209,7 +209,7 @@ class Vp8RcInterfaceTest
if (test_video_.width == 640 && target_bitrate_ == 1000) return;
SetConfigTemporalLayers(3);
rc_api_ = libvpx::VP8RateControlRTC::Create(rc_cfg_);
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
::libvpx_test::I420VideoSource video(test_video_.name, test_video_.width,
test_video_.height, 30, 1, 0,
diff --git a/test/vp9_ratectrl_rtc_test.cc b/test/vp9_ratectrl_rtc_test.cc
index c6ab5b034..5abda1290 100644
--- a/test/vp9_ratectrl_rtc_test.cc
+++ b/test/vp9_ratectrl_rtc_test.cc
@@ -212,7 +212,7 @@ class RcInterfaceSvcTest
rc_cfg_.layer_target_bitrate[6] = 0;
rc_cfg_.layer_target_bitrate[7] = 0;
rc_cfg_.layer_target_bitrate[8] = 0;
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
} else if (video->frame() == 200) {
// Go down to 1 spatial layer.
// Update the encoder config.
@@ -226,7 +226,7 @@ class RcInterfaceSvcTest
rc_cfg_.layer_target_bitrate[3] = 0;
rc_cfg_.layer_target_bitrate[4] = 0;
rc_cfg_.layer_target_bitrate[5] = 0;
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
} else if (0 && video->frame() == 280) {
// TODO(marpan): Re-enable this going back up when issue is fixed.
// Go back up to 3 spatial layers.
@@ -235,7 +235,7 @@ class RcInterfaceSvcTest
encoder->Config(&cfg_);
// Update the RC config.
SetRCConfigSvc(3, 3);
- rc_api_->UpdateRateControl(rc_cfg_);
+ ASSERT_TRUE(rc_api_->UpdateRateControl(rc_cfg_));
}
}
}