OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 200, // CIF | 62 200, // CIF |
63 280, // HVGA | 63 280, // HVGA |
64 400, // VGA | 64 400, // VGA |
65 700, // QFULLHD | 65 700, // QFULLHD |
66 1000, // WHD | 66 1000, // WHD |
67 1500 // FULLHD | 67 1500 // FULLHD |
68 }; | 68 }; |
69 | 69 |
70 // Frame rate scale for maximum transition rate. | 70 // Frame rate scale for maximum transition rate. |
71 const float kFrameRateFac[4] = { | 71 const float kFrameRateFac[4] = { |
72 0.5f, // Low | 72 0.5f, // Low |
73 0.7f, // Middle level 1 | 73 0.7f, // Middle level 1 |
74 0.85f, // Middle level 2 | 74 0.85f, // Middle level 2 |
75 1.0f, // High | 75 1.0f, // High |
76 }; | 76 }; |
77 | 77 |
78 // Scale for transitional rate: based on content class | 78 // Scale for transitional rate: based on content class |
79 // motion=L/H/D,spatial==L/H/D: for low, high, middle levels | 79 // motion=L/H/D,spatial==L/H/D: for low, high, middle levels |
80 const float kScaleTransRateQm[18] = { | 80 const float kScaleTransRateQm[18] = { |
81 // VGA and lower | 81 // VGA and lower |
82 0.40f, // L, L | 82 0.40f, // L, L |
83 0.50f, // L, H | 83 0.50f, // L, H |
84 0.40f, // L, D | 84 0.40f, // L, D |
85 0.60f, // H ,L | 85 0.60f, // H ,L |
86 0.60f, // H, H | 86 0.60f, // H, H |
87 0.60f, // H, D | 87 0.60f, // H, D |
88 0.50f, // D, L | 88 0.50f, // D, L |
89 0.50f, // D, D | 89 0.50f, // D, D |
90 0.50f, // D, H | 90 0.50f, // D, H |
91 | 91 |
92 // over VGA | 92 // over VGA |
93 0.40f, // L, L | 93 0.40f, // L, L |
94 0.50f, // L, H | 94 0.50f, // L, H |
95 0.40f, // L, D | 95 0.40f, // L, D |
96 0.60f, // H ,L | 96 0.60f, // H ,L |
97 0.60f, // H, H | 97 0.60f, // H, H |
98 0.60f, // H, D | 98 0.60f, // H, D |
99 0.50f, // D, L | 99 0.50f, // D, L |
100 0.50f, // D, D | 100 0.50f, // D, D |
101 0.50f, // D, H | 101 0.50f, // D, H |
102 }; | 102 }; |
103 | 103 |
104 // Threshold on the target rate relative to transitional rate. | 104 // Threshold on the target rate relative to transitional rate. |
105 const float kFacLowRate = 0.5f; | 105 const float kFacLowRate = 0.5f; |
106 | 106 |
107 // Action for down-sampling: | 107 // Action for down-sampling: |
108 // motion=L/H/D,spatial==L/H/D, for low, high, middle levels; | 108 // motion=L/H/D,spatial==L/H/D, for low, high, middle levels; |
109 // rate = 0/1/2, for target rate state relative to transition rate. | 109 // rate = 0/1/2, for target rate state relative to transition rate. |
110 const uint8_t kSpatialAction[27] = { | 110 const uint8_t kSpatialAction[27] = { |
111 // rateClass = 0: | 111 // rateClass = 0: |
112 1, // L, L | 112 1, // L, L |
113 1, // L, H | 113 1, // L, H |
114 1, // L, D | 114 1, // L, D |
115 4, // H ,L | 115 4, // H ,L |
116 1, // H, H | 116 1, // H, H |
117 4, // H, D | 117 4, // H, D |
118 4, // D, L | 118 4, // D, L |
119 1, // D, H | 119 1, // D, H |
120 2, // D, D | 120 2, // D, D |
121 | 121 |
122 // rateClass = 1: | 122 // rateClass = 1: |
123 1, // L, L | 123 1, // L, L |
124 1, // L, H | 124 1, // L, H |
125 1, // L, D | 125 1, // L, D |
126 2, // H ,L | 126 2, // H ,L |
127 1, // H, H | 127 1, // H, H |
128 2, // H, D | 128 2, // H, D |
129 2, // D, L | 129 2, // D, L |
130 1, // D, H | 130 1, // D, H |
131 2, // D, D | 131 2, // D, D |
132 | 132 |
133 // rateClass = 2: | 133 // rateClass = 2: |
134 1, // L, L | 134 1, // L, L |
135 1, // L, H | 135 1, // L, H |
136 1, // L, D | 136 1, // L, D |
137 2, // H ,L | 137 2, // H ,L |
138 1, // H, H | 138 1, // H, H |
139 2, // H, D | 139 2, // H, D |
140 2, // D, L | 140 2, // D, L |
141 1, // D, H | 141 1, // D, H |
142 2, // D, D | 142 2, // D, D |
143 }; | 143 }; |
144 | 144 |
145 const uint8_t kTemporalAction[27] = { | 145 const uint8_t kTemporalAction[27] = { |
146 // rateClass = 0: | 146 // rateClass = 0: |
147 3, // L, L | 147 3, // L, L |
148 2, // L, H | 148 2, // L, H |
149 2, // L, D | 149 2, // L, D |
150 1, // H ,L | 150 1, // H ,L |
151 3, // H, H | 151 3, // H, H |
152 1, // H, D | 152 1, // H, D |
153 1, // D, L | 153 1, // D, L |
154 2, // D, H | 154 2, // D, H |
155 1, // D, D | 155 1, // D, D |
156 | 156 |
157 // rateClass = 1: | 157 // rateClass = 1: |
158 3, // L, L | 158 3, // L, L |
159 3, // L, H | 159 3, // L, H |
160 3, // L, D | 160 3, // L, D |
161 1, // H ,L | 161 1, // H ,L |
162 3, // H, H | 162 3, // H, H |
163 1, // H, D | 163 1, // H, D |
164 1, // D, L | 164 1, // D, L |
165 3, // D, H | 165 3, // D, H |
166 1, // D, D | 166 1, // D, D |
167 | 167 |
168 // rateClass = 2: | 168 // rateClass = 2: |
169 1, // L, L | 169 1, // L, L |
170 3, // L, H | 170 3, // L, H |
171 3, // L, D | 171 3, // L, D |
172 1, // H ,L | 172 1, // H ,L |
173 3, // H, H | 173 3, // H, H |
174 1, // H, D | 174 1, // H, D |
175 1, // D, L | 175 1, // D, L |
176 3, // D, H | 176 3, // D, H |
177 1, // D, D | 177 1, // D, D |
178 }; | 178 }; |
179 | 179 |
180 // Control the total amount of down-sampling allowed. | 180 // Control the total amount of down-sampling allowed. |
181 const float kMaxSpatialDown = 8.0f; | 181 const float kMaxSpatialDown = 8.0f; |
182 const float kMaxTempDown = 3.0f; | 182 const float kMaxTempDown = 3.0f; |
183 const float kMaxTotalDown = 9.0f; | 183 const float kMaxTotalDown = 9.0f; |
184 | 184 |
185 // Minimum image size for a spatial down-sampling. | 185 // Minimum image size for a spatial down-sampling. |
186 const int kMinImageSize = 176 * 144; | 186 const int kMinImageSize = 176 * 144; |
187 | 187 |
(...skipping 30 matching lines...) Expand all Loading... |
218 // Percentage reduction in transitional bitrate for 2x2 selected over 1x2/2x1. | 218 // Percentage reduction in transitional bitrate for 2x2 selected over 1x2/2x1. |
219 const float kRateRedSpatial2X2 = 0.6f; | 219 const float kRateRedSpatial2X2 = 0.6f; |
220 | 220 |
221 const float kSpatialErr2x2VsHoriz = 0.1f; // percentage to favor 2x2 over H | 221 const float kSpatialErr2x2VsHoriz = 0.1f; // percentage to favor 2x2 over H |
222 const float kSpatialErr2X2VsVert = 0.1f; // percentage to favor 2x2 over V | 222 const float kSpatialErr2X2VsVert = 0.1f; // percentage to favor 2x2 over V |
223 const float kSpatialErrVertVsHoriz = 0.1f; // percentage to favor H over V | 223 const float kSpatialErrVertVsHoriz = 0.1f; // percentage to favor H over V |
224 | 224 |
225 } // namespace webrtc | 225 } // namespace webrtc |
226 | 226 |
227 #endif // WEBRTC_MODULES_VIDEO_CODING_QM_SELECT_DATA_H_ | 227 #endif // WEBRTC_MODULES_VIDEO_CODING_QM_SELECT_DATA_H_ |
OLD | NEW |