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

Side by Side Diff: webrtc/modules/video_coding/utility/quality_scaler.cc

Issue 2248883002: Make prior H264 QP adjustments iOS specific. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 #if defined(WEBRTC_IOS)
41 const int QualityScaler::kLowH264QpThreshold = 32; 42 const int QualityScaler::kLowH264QpThreshold = 32;
42 const int QualityScaler::kBadH264QpThreshold = 42; 43 const int QualityScaler::kBadH264QpThreshold = 42;
44 #else
45 const int QualityScaler::kLowH264QpThreshold = 22;
46 const int QualityScaler::kBadH264QpThreshold = 35;
47 #endif
43 48
44 QualityScaler::QualityScaler() : low_qp_threshold_(-1) {} 49 QualityScaler::QualityScaler() : low_qp_threshold_(-1) {}
45 50
46 void QualityScaler::Init(int low_qp_threshold, 51 void QualityScaler::Init(int low_qp_threshold,
47 int high_qp_threshold, 52 int high_qp_threshold,
48 int initial_bitrate_kbps, 53 int initial_bitrate_kbps,
49 int width, 54 int width,
50 int height, 55 int height,
51 int fps) { 56 int fps) {
52 ClearSamples(); 57 ClearSamples();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (downscale_shift_ < 0) 182 if (downscale_shift_ < 0)
178 downscale_shift_ = 0; 183 downscale_shift_ = 0;
179 if (!up) { 184 if (!up) {
180 // First downscale hit, start using a slower threshold for going up. 185 // First downscale hit, start using a slower threshold for going up.
181 measure_seconds_upscale_ = kMeasureSecondsUpscale; 186 measure_seconds_upscale_ = kMeasureSecondsUpscale;
182 UpdateSampleCounts(); 187 UpdateSampleCounts();
183 } 188 }
184 } 189 }
185 190
186 } // namespace webrtc 191 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698