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

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

Issue 2309743002: Move the QP scaling thresholds to the relevant encoders (Closed)
Patch Set: fix namespace issue in videoToolbox encoder 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 20 matching lines...) Expand all
31 int fps); 31 int fps);
32 void ReportFramerate(int framerate); 32 void ReportFramerate(int framerate);
33 void ReportQP(int qp); 33 void ReportQP(int qp);
34 void ReportDroppedFrame(); 34 void ReportDroppedFrame();
35 void OnEncodeFrame(int width, int height); 35 void OnEncodeFrame(int width, int height);
36 Resolution GetScaledResolution() const; 36 Resolution GetScaledResolution() const;
37 rtc::scoped_refptr<VideoFrameBuffer> GetScaledBuffer( 37 rtc::scoped_refptr<VideoFrameBuffer> GetScaledBuffer(
38 const rtc::scoped_refptr<VideoFrameBuffer>& frame); 38 const rtc::scoped_refptr<VideoFrameBuffer>& frame);
39 int downscale_shift() const { return downscale_shift_; } 39 int downscale_shift() const { return downscale_shift_; }
40 40
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].
43 static const int kLowVp8QpThreshold;
pbos-webrtc 2016/09/12 19:51:49 I think this might be the best place for the defau
44 static const int kBadVp8QpThreshold;
45
46 // H264 QP is in the range [0, 51].
47 static const int kLowH264QpThreshold;
48 static const int kBadH264QpThreshold;
49
50 private: 41 private:
51 void AdjustScale(bool up); 42 void AdjustScale(bool up);
52 void UpdateTargetResolution(int frame_width, int frame_height); 43 void UpdateTargetResolution(int frame_width, int frame_height);
53 void ClearSamples(); 44 void ClearSamples();
54 void UpdateSampleCounts(); 45 void UpdateSampleCounts();
55 46
56 I420BufferPool pool_; 47 I420BufferPool pool_;
57 48
58 size_t num_samples_downscale_; 49 size_t num_samples_downscale_;
59 size_t num_samples_upscale_; 50 size_t num_samples_upscale_;
60 int measure_seconds_upscale_; 51 int measure_seconds_upscale_;
61 MovingAverage<int> average_qp_upscale_; 52 MovingAverage<int> average_qp_upscale_;
62 MovingAverage<int> average_qp_downscale_; 53 MovingAverage<int> average_qp_downscale_;
63 54
64 int framerate_; 55 int framerate_;
65 int low_qp_threshold_; 56 int low_qp_threshold_;
66 int high_qp_threshold_; 57 int high_qp_threshold_;
67 MovingAverage<int> framedrop_percent_; 58 MovingAverage<int> framedrop_percent_;
68 Resolution res_; 59 Resolution res_;
69 60
70 int downscale_shift_; 61 int downscale_shift_;
71 }; 62 };
72 63
73 } // namespace webrtc 64 } // namespace webrtc
74 65
75 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_ 66 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_QUALITY_SCALER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698