Chromium Code Reviews| Index: webrtc/modules/video_coding/utility/quality_scaler.cc |
| diff --git a/webrtc/modules/video_coding/utility/quality_scaler.cc b/webrtc/modules/video_coding/utility/quality_scaler.cc |
| index 76bf9f5b0399ed0d7558eed398f6894797490672..577f9a1bfe35604c697b46aef4d7196f0ed4dcfa 100644 |
| --- a/webrtc/modules/video_coding/utility/quality_scaler.cc |
| +++ b/webrtc/modules/video_coding/utility/quality_scaler.cc |
| @@ -14,6 +14,8 @@ namespace webrtc { |
| static const int kMinFps = 10; |
| static const int kMeasureSeconds = 5; |
| static const int kFramedropPercentThreshold = 60; |
| +static const int kHDResolutionThreshold = 700 * 500; |
| +static const int kHDBitrateThresholdKbps = 500; |
|
stefan-webrtc
2016/02/19 10:29:32
kHd... (lower case "d") for both these constants.
AlexG
2016/02/19 20:07:46
Done.
|
| const int QualityScaler::kDefaultLowQpDenominator = 3; |
| // Note that this is the same for width and height to permit 120x90 in both |
| @@ -30,11 +32,25 @@ QualityScaler::QualityScaler() |
| void QualityScaler::Init(int low_qp_threshold, |
| int high_qp_threshold, |
| - bool use_framerate_reduction) { |
| + bool use_framerate_reduction, |
| + int initial_bitrate_kbps, |
| + int width, |
| + int height) { |
| ClearSamples(); |
| low_qp_threshold_ = low_qp_threshold; |
| high_qp_threshold_ = high_qp_threshold; |
| use_framerate_reduction_ = use_framerate_reduction; |
| + // TODO(glaznev): Investigate using thresholds for other resolutions |
| + // or threshold tables. |
| + if (initial_bitrate_kbps > 0 && |
| + initial_bitrate_kbps < kHDBitrateThresholdKbps) { |
| + // Start scaling to roughly VGA. |
| + while (width * height > kHDResolutionThreshold) { |
| + ++downscale_shift_; |
| + width /= 2; |
| + height /= 2; |
| + } |
| + } |
| target_framerate_ = -1; |
| } |