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

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

Issue 2310853002: Refactor QualityScaler and MovingAverage (Closed)
Patch Set: fix build error Created 4 years, 3 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
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 30 matching lines...) Expand all
41 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the 41 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the
42 // bitstream range of [0, 127] and not the user-level range of [0,63]. 42 // bitstream range of [0, 127] and not the user-level range of [0,63].
43 static const int kLowVp8QpThreshold; 43 static const int kLowVp8QpThreshold;
44 static const int kBadVp8QpThreshold; 44 static const int kBadVp8QpThreshold;
45 45
46 // H264 QP is in the range [0, 51]. 46 // H264 QP is in the range [0, 51].
47 static const int kLowH264QpThreshold; 47 static const int kLowH264QpThreshold;
48 static const int kBadH264QpThreshold; 48 static const int kBadH264QpThreshold;
49 49
50 private: 50 private:
51 void AdjustScale(bool up);
52 void UpdateTargetResolution(int frame_width, int frame_height);
53 void ClearSamples(); 51 void ClearSamples();
54 void UpdateSampleCounts(); 52 void ScaleUp();
53 void ScaleDown();
54 void UpdateTargetResolution(int width, int height);
55 55
56 I420BufferPool pool_; 56 I420BufferPool pool_;
57 57
58 size_t num_samples_downscale_; 58 size_t num_samples_downscale_;
59 size_t num_samples_upscale_; 59 size_t num_samples_upscale_;
60 int measure_seconds_upscale_; 60 bool fast_rampup_;
61 MovingAverage<int> average_qp_upscale_; 61 MovingAverage average_qp_;
62 MovingAverage<int> average_qp_downscale_; 62 MovingAverage framedrop_percent_;
63 63
64 int framerate_;
65 int low_qp_threshold_; 64 int low_qp_threshold_;
66 int high_qp_threshold_; 65 int high_qp_threshold_;
67 MovingAverage<int> framedrop_percent_; 66 Resolution target_res_;
68 Resolution res_;
69 67
70 int downscale_shift_; 68 int downscale_shift_;
69 int maximum_shift_;
71 }; 70 };
72 71
73 } // namespace webrtc 72 } // namespace webrtc
74 73
75 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_ 74 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/utility/moving_average_unittest.cc ('k') | webrtc/modules/video_coding/utility/quality_scaler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698