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 20 matching lines...) Expand all Loading... |
31 static const int kQvgaNumPixels = 400 * 300; // 320x240 | 31 static const int kQvgaNumPixels = 400 * 300; // 320x240 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 // QP thresholds are chosen to be high enough to be hit in practice when quality | 34 // QP thresholds are chosen to be high enough to be hit in practice when quality |
35 // is good, but also low enough to not cause a flip-flop behavior (e.g. going up | 35 // is good, but also low enough to not cause a flip-flop behavior (e.g. going up |
36 // in resolution shouldn't give so bad quality that we should go back down). | 36 // in resolution shouldn't give so bad quality that we should go back down). |
37 | 37 |
38 const int QualityScaler::kLowVp8QpThreshold = 29; | 38 const int QualityScaler::kLowVp8QpThreshold = 29; |
39 const int QualityScaler::kBadVp8QpThreshold = 95; | 39 const int QualityScaler::kBadVp8QpThreshold = 95; |
40 | 40 |
41 const int QualityScaler::kLowH264QpThreshold = 22; | 41 const int QualityScaler::kLowH264QpThreshold = 32; |
42 const int QualityScaler::kBadH264QpThreshold = 35; | 42 const int QualityScaler::kBadH264QpThreshold = 42; |
43 | 43 |
44 QualityScaler::QualityScaler() : low_qp_threshold_(-1) {} | 44 QualityScaler::QualityScaler() : low_qp_threshold_(-1) {} |
45 | 45 |
46 void QualityScaler::Init(int low_qp_threshold, | 46 void QualityScaler::Init(int low_qp_threshold, |
47 int high_qp_threshold, | 47 int high_qp_threshold, |
48 int initial_bitrate_kbps, | 48 int initial_bitrate_kbps, |
49 int width, | 49 int width, |
50 int height, | 50 int height, |
51 int fps) { | 51 int fps) { |
52 ClearSamples(); | 52 ClearSamples(); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 if (downscale_shift_ < 0) | 177 if (downscale_shift_ < 0) |
178 downscale_shift_ = 0; | 178 downscale_shift_ = 0; |
179 if (!up) { | 179 if (!up) { |
180 // First downscale hit, start using a slower threshold for going up. | 180 // First downscale hit, start using a slower threshold for going up. |
181 measure_seconds_upscale_ = kMeasureSecondsUpscale; | 181 measure_seconds_upscale_ = kMeasureSecondsUpscale; |
182 UpdateSampleCounts(); | 182 UpdateSampleCounts(); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 } // namespace webrtc | 186 } // namespace webrtc |
OLD | NEW |