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

Unified Diff: webrtc/modules/video_coding/utility/quality_scaler_unittest.cc

Issue 2309743002: Move the QP scaling thresholds to the relevant encoders (Closed)
Patch Set: rebase Created 4 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/video_coding/utility/quality_scaler_unittest.cc
diff --git a/webrtc/modules/video_coding/utility/quality_scaler_unittest.cc b/webrtc/modules/video_coding/utility/quality_scaler_unittest.cc
index 2bbd26d7607d3dc20b8393cee200faa76d6d05d9..0408833a122cf66fa1ff0fe6318d702a31e6e160 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler_unittest.cc
+++ b/webrtc/modules/video_coding/utility/quality_scaler_unittest.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/common_types.h"
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -43,7 +44,8 @@ class QualityScalerTest : public ::testing::Test {
QualityScalerTest() {
input_frame_ = I420Buffer::Create(kWidth, kHeight);
- qs_.Init(kLowQpThreshold, kHighQp, 0, kWidth, kHeight, kFramerate);
+ qs_.Init(kVideoCodecH264, 0, kWidth, kHeight, kFramerate, kLowQpThreshold,
+ kHighQp);
qs_.OnEncodeFrame(input_frame_->width(), input_frame_->height());
}
@@ -260,8 +262,8 @@ TEST_F(QualityScalerTest, DownscaleToVgaOnLowInitialBitrate) {
static const int kHeight720p = 720;
static const int kInitialBitrateKbps = 300;
input_frame_ = I420Buffer::Create(kWidth720p, kHeight720p);
- qs_.Init(kLowQpThreshold, kDisabledBadQpThreshold, kInitialBitrateKbps,
- kWidth720p, kHeight720p, kFramerate);
+ qs_.Init(kVideoCodecH264, kInitialBitrateKbps, kWidth720p, kHeight720p,
+ kFramerate, kLowQpThreshold, kDisabledBadQpThreshold);
qs_.OnEncodeFrame(input_frame_->width(), input_frame_->height());
int init_width = qs_.GetScaledResolution().width;
int init_height = qs_.GetScaledResolution().height;
@@ -274,8 +276,8 @@ TEST_F(QualityScalerTest, DownscaleToQvgaOnLowerInitialBitrate) {
static const int kHeight720p = 720;
static const int kInitialBitrateKbps = 200;
input_frame_ = I420Buffer::Create(kWidth720p, kHeight720p);
- qs_.Init(kLowQpThreshold, kDisabledBadQpThreshold, kInitialBitrateKbps,
- kWidth720p, kHeight720p, kFramerate);
+ qs_.Init(kVideoCodecH264, kInitialBitrateKbps, kWidth720p, kHeight720p,
+ kFramerate, kLowQpThreshold, kDisabledBadQpThreshold);
qs_.OnEncodeFrame(input_frame_->width(), input_frame_->height());
int init_width = qs_.GetScaledResolution().width;
int init_height = qs_.GetScaledResolution().height;
@@ -284,7 +286,8 @@ TEST_F(QualityScalerTest, DownscaleToQvgaOnLowerInitialBitrate) {
}
TEST_F(QualityScalerTest, DownscaleAfterMeasuredSecondsThenSlowerBackUp) {
- qs_.Init(kLowQpThreshold, kHighQp, 0, kWidth, kHeight, kFramerate);
+ qs_.Init(kVideoCodecH264, 0, kWidth, kHeight, kFramerate, kLowQpThreshold,
+ kHighQp);
qs_.OnEncodeFrame(input_frame_->width(), input_frame_->height());
QualityScaler::Resolution initial_res = qs_.GetScaledResolution();
@@ -321,8 +324,8 @@ TEST_F(QualityScalerTest, DownscaleAfterMeasuredSecondsThenSlowerBackUp) {
}
TEST_F(QualityScalerTest, UpscaleQuicklyInitiallyAfterMeasuredSeconds) {
- qs_.Init(kLowQpThreshold, kHighQp, kLowInitialBitrateKbps, kWidth, kHeight,
- kFramerate);
+ qs_.Init(kVideoCodecH264, kLowInitialBitrateKbps, kWidth, kHeight, kFramerate,
+ kLowQpThreshold, kHighQp);
qs_.OnEncodeFrame(input_frame_->width(), input_frame_->height());
QualityScaler::Resolution initial_res = qs_.GetScaledResolution();

Powered by Google App Engine
This is Rietveld 408576698