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 17 matching lines...) Expand all Loading... |
28 void Init(int low_qp_threshold, bool use_framerate_reduction); | 28 void Init(int low_qp_threshold, bool use_framerate_reduction); |
29 void SetMinResolution(int min_width, int min_height); | 29 void SetMinResolution(int min_width, int min_height); |
30 void ReportFramerate(int framerate); | 30 void ReportFramerate(int framerate); |
31 void ReportQP(int qp); | 31 void ReportQP(int qp); |
32 void ReportDroppedFrame(); | 32 void ReportDroppedFrame(); |
33 void Reset(int framerate, int bitrate, int width, int height); | 33 void Reset(int framerate, int bitrate, int width, int height); |
34 void OnEncodeFrame(const VideoFrame& frame); | 34 void OnEncodeFrame(const VideoFrame& frame); |
35 Resolution GetScaledResolution() const; | 35 Resolution GetScaledResolution() const; |
36 const VideoFrame& GetScaledFrame(const VideoFrame& frame); | 36 const VideoFrame& GetScaledFrame(const VideoFrame& frame); |
37 int GetTargetFramerate() const; | 37 int GetTargetFramerate() const; |
| 38 int downscale_shift() const { return downscale_shift_; } |
38 | 39 |
39 private: | 40 private: |
40 void AdjustScale(bool up); | 41 void AdjustScale(bool up); |
41 void ClearSamples(); | 42 void ClearSamples(); |
42 | 43 |
43 Scaler scaler_; | 44 Scaler scaler_; |
44 VideoFrame scaled_frame_; | 45 VideoFrame scaled_frame_; |
45 | 46 |
46 size_t num_samples_; | 47 size_t num_samples_; |
47 int framerate_; | 48 int framerate_; |
48 int target_framerate_; | 49 int target_framerate_; |
49 int low_qp_threshold_; | 50 int low_qp_threshold_; |
50 MovingAverage<int> framedrop_percent_; | 51 MovingAverage<int> framedrop_percent_; |
51 MovingAverage<int> average_qp_; | 52 MovingAverage<int> average_qp_; |
52 Resolution res_; | 53 Resolution res_; |
53 | 54 |
54 int downscale_shift_; | 55 int downscale_shift_; |
55 int framerate_down_; | 56 int framerate_down_; |
56 bool use_framerate_reduction_; | 57 bool use_framerate_reduction_; |
57 int min_width_; | 58 int min_width_; |
58 int min_height_; | 59 int min_height_; |
59 }; | 60 }; |
60 | 61 |
61 } // namespace webrtc | 62 } // namespace webrtc |
62 | 63 |
63 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_ | 64 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_ |
OLD | NEW |