| 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 30 matching lines...) Expand all Loading... |
| 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 UpdateTargetResolution(int width, int height); |
| 55 | 53 |
| 56 I420BufferPool pool_; | 54 I420BufferPool pool_; |
| 57 | 55 |
| 58 size_t num_samples_downscale_; | 56 size_t num_samples_downscale_; |
| 59 size_t num_samples_upscale_; | 57 size_t num_samples_upscale_; |
| 60 int measure_seconds_upscale_; | 58 bool fast_rampup_; |
| 61 MovingAverage<int> average_qp_upscale_; | 59 MovingAverage average_qp_; |
| 62 MovingAverage<int> average_qp_downscale_; | 60 MovingAverage framedrop_percent_; |
| 63 | 61 |
| 64 int framerate_; | |
| 65 int low_qp_threshold_; | 62 int low_qp_threshold_; |
| 66 int high_qp_threshold_; | 63 int high_qp_threshold_; |
| 67 MovingAverage<int> framedrop_percent_; | |
| 68 Resolution res_; | 64 Resolution res_; |
| 69 | 65 |
| 70 int downscale_shift_; | 66 int downscale_shift_; |
| 67 int maximum_shift_; |
| 71 }; | 68 }; |
| 72 | 69 |
| 73 } // namespace webrtc | 70 } // namespace webrtc |
| 74 | 71 |
| 75 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_ | 72 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_ |
| OLD | NEW |