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

Unified Diff: webrtc/video/vie_encoder.cc

Issue 2538913003: Remove limit on how often quality scaling downscales. (Closed)
Patch Set: size_t -> int Created 4 years 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
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index 5722d06c1e651a4961896e49e774e83e9ed5218d..343cd4c8f0c3c4d109b31a64244f516cae7c3326 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -32,6 +32,8 @@ namespace webrtc {
namespace {
// Time interval for logging frame counts.
const int64_t kFrameLogIntervalMs = 60000;
+// We will never ask for a resolution lower than this.
+const int kMinPixelsPerFrame = 120 * 90;
// TODO(pbos): Lower these thresholds (to closer to 100%) when we handle
// pipelining encoders better (multiple input frames before something comes
@@ -176,7 +178,10 @@ class ViEEncoder::VideoSourceProxy {
// The input video frame size will have a resolution with less than or
// equal to |max_pixel_count| depending on how the source can scale the
// input frame size.
- sink_wants_.max_pixel_count = rtc::Optional<int>((pixel_count * 3) / 5);
+ const int pixels_wanted = (pixel_count * 3) / 5;
+ if (pixels_wanted < kMinPixelsPerFrame)
+ return;
+ sink_wants_.max_pixel_count = rtc::Optional<int>(pixels_wanted);
sink_wants_.max_pixel_count_step_up = rtc::Optional<int>();
if (source_)
source_->AddOrUpdateSink(vie_encoder_, sink_wants_);
@@ -681,8 +686,6 @@ void ViEEncoder::ScaleDown(ScaleReason reason) {
return;
switch (reason) {
case kQuality:
- if (scale_counter_[reason] >= kMaxQualityDowngrades)
- return;
stats_proxy_->OnQualityRestrictedResolutionChanged(true);
break;
case kCpu:
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698