| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 static const int kHeightVga = 480; | 22 static const int kHeightVga = 480; |
| 23 static const int kFramerate = 30; | 23 static const int kFramerate = 30; |
| 24 static const int kLowQp = 15; | 24 static const int kLowQp = 15; |
| 25 static const int kNormalQp = 30; | 25 static const int kNormalQp = 30; |
| 26 static const int kLowQpThreshold = 18; | 26 static const int kLowQpThreshold = 18; |
| 27 static const int kHighQp = 40; | 27 static const int kHighQp = 40; |
| 28 static const int kDisabledBadQpThreshold = 64; | 28 static const int kDisabledBadQpThreshold = 64; |
| 29 static const int kLowInitialBitrateKbps = 300; | 29 static const int kLowInitialBitrateKbps = 300; |
| 30 // These values need to be in sync with corresponding constants | 30 // These values need to be in sync with corresponding constants |
| 31 // in quality_scaler.cc | 31 // in quality_scaler.cc |
| 32 static const int kMeasureSecondsDownscale = 3; | |
| 33 static const int kMeasureSecondsFastUpscale = 2; | 32 static const int kMeasureSecondsFastUpscale = 2; |
| 34 static const int kMeasureSecondsUpscale = 5; | 33 static const int kMeasureSecondsUpscale = 5; |
| 34 static const int kMeasureSecondsDownscale = 5; |
| 35 static const int kMinDownscaleDimension = 140; | 35 static const int kMinDownscaleDimension = 140; |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 class QualityScalerTest : public ::testing::Test { | 38 class QualityScalerTest : public ::testing::Test { |
| 39 public: | 39 public: |
| 40 // Temporal and spatial resolution. | 40 // Temporal and spatial resolution. |
| 41 struct Resolution { | 41 struct Resolution { |
| 42 int framerate; | 42 int framerate; |
| 43 int width; | 43 int width; |
| 44 int height; | 44 int height; |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 488 |
| 489 TEST_F(QualityScalerTest, DownscalesFrom1280x720To320x180) { | 489 TEST_F(QualityScalerTest, DownscalesFrom1280x720To320x180) { |
| 490 DownscaleEndsAt(1280, 720, 320, 180); | 490 DownscaleEndsAt(1280, 720, 320, 180); |
| 491 } | 491 } |
| 492 | 492 |
| 493 TEST_F(QualityScalerTest, DoesntDownscaleInitialQvga) { | 493 TEST_F(QualityScalerTest, DoesntDownscaleInitialQvga) { |
| 494 DownscaleEndsAt(320, 180, 320, 180); | 494 DownscaleEndsAt(320, 180, 320, 180); |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace webrtc | 497 } // namespace webrtc |
| OLD | NEW |