OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM 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 26 matching lines...) Expand all Loading... |
37 // Allow recode for all frames based on bitrate constraints. | 37 // Allow recode for all frames based on bitrate constraints. |
38 ALLOW_RECODE = 3, | 38 ALLOW_RECODE = 3, |
39 } RECODE_LOOP_TYPE; | 39 } RECODE_LOOP_TYPE; |
40 | 40 |
41 typedef enum { | 41 typedef enum { |
42 SUBPEL_TREE = 0, | 42 SUBPEL_TREE = 0, |
43 // Other methods to come | 43 // Other methods to come |
44 } SUBPEL_SEARCH_METHODS; | 44 } SUBPEL_SEARCH_METHODS; |
45 | 45 |
46 typedef enum { | 46 typedef enum { |
| 47 NO_MOITION_THRESHOLD = 0, |
| 48 LOW_MOITION_THRESHOLD = 7 |
| 49 } MOTION_THRESHOLD; |
| 50 |
| 51 typedef enum { |
47 LAST_FRAME_PARTITION_OFF = 0, | 52 LAST_FRAME_PARTITION_OFF = 0, |
48 LAST_FRAME_PARTITION_LOW_MOTION = 1, | 53 LAST_FRAME_PARTITION_LOW_MOTION = 1, |
49 LAST_FRAME_PARTITION_ALL = 2 | 54 LAST_FRAME_PARTITION_ALL = 2 |
50 } LAST_FRAME_PARTITION_METHOD; | 55 } LAST_FRAME_PARTITION_METHOD; |
51 | 56 |
52 typedef enum { | 57 typedef enum { |
53 USE_FULL_RD = 0, | 58 USE_FULL_RD = 0, |
54 USE_LARGESTINTRA, | 59 USE_LARGESTALL, |
55 USE_LARGESTINTRA_MODELINTER, | 60 USE_TX_8X8 |
56 USE_LARGESTALL | |
57 } TX_SIZE_SEARCH_METHOD; | 61 } TX_SIZE_SEARCH_METHOD; |
58 | 62 |
59 typedef enum { | 63 typedef enum { |
60 NOT_IN_USE = 0, | 64 NOT_IN_USE = 0, |
61 RELAXED_NEIGHBORING_MIN_MAX = 1, | 65 RELAXED_NEIGHBORING_MIN_MAX = 1, |
62 STRICT_NEIGHBORING_MIN_MAX = 2 | 66 STRICT_NEIGHBORING_MIN_MAX = 2 |
63 } AUTO_MIN_MAX_MODE; | 67 } AUTO_MIN_MAX_MODE; |
64 | 68 |
65 typedef enum { | 69 typedef enum { |
66 // Try the full image with different values. | 70 // Try the full image with different values. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 TWO_LOOP = 0, | 126 TWO_LOOP = 0, |
123 | 127 |
124 // No dry run conducted. | 128 // No dry run conducted. |
125 ONE_LOOP = 1, | 129 ONE_LOOP = 1, |
126 | 130 |
127 // No dry run, also only half the coef contexts and bands are updated. | 131 // No dry run, also only half the coef contexts and bands are updated. |
128 // The rest are not updated at all. | 132 // The rest are not updated at all. |
129 ONE_LOOP_REDUCED = 2 | 133 ONE_LOOP_REDUCED = 2 |
130 } FAST_COEFF_UPDATE; | 134 } FAST_COEFF_UPDATE; |
131 | 135 |
132 typedef struct SPEED_FEATURES { | 136 typedef struct MV_SPEED_FEATURES { |
133 // Frame level coding parameter update | |
134 int frame_parameter_update; | |
135 | |
136 // Motion search method (Diamond, NSTEP, Hex, Big Diamond, Square, etc). | 137 // Motion search method (Diamond, NSTEP, Hex, Big Diamond, Square, etc). |
137 SEARCH_METHODS search_method; | 138 SEARCH_METHODS search_method; |
138 | 139 |
139 RECODE_LOOP_TYPE recode_loop; | 140 // This parameter controls the number of steps we'll do in a diamond |
| 141 // search. |
| 142 int max_step_search_steps; |
| 143 |
| 144 // This parameter controls which step in the n-step process we start at. |
| 145 // It's changed adaptively based on circumstances. |
| 146 int reduce_first_step_size; |
| 147 |
| 148 // If this is set to 1, we limit the motion search range to 2 times the |
| 149 // largest motion vector found in the last frame. |
| 150 int auto_mv_step_size; |
140 | 151 |
141 // Subpel_search_method can only be subpel_tree which does a subpixel | 152 // Subpel_search_method can only be subpel_tree which does a subpixel |
142 // logarithmic search that keeps stepping at 1/2 pixel units until | 153 // logarithmic search that keeps stepping at 1/2 pixel units until |
143 // you stop getting a gain, and then goes on to 1/4 and repeats | 154 // you stop getting a gain, and then goes on to 1/4 and repeats |
144 // the same process. Along the way it skips many diagonals. | 155 // the same process. Along the way it skips many diagonals. |
145 SUBPEL_SEARCH_METHODS subpel_search_method; | 156 SUBPEL_SEARCH_METHODS subpel_search_method; |
146 | 157 |
147 // Maximum number of steps in logarithmic subpel search before giving up. | 158 // Maximum number of steps in logarithmic subpel search before giving up. |
148 int subpel_iters_per_step; | 159 int subpel_iters_per_step; |
149 | 160 |
150 // Control when to stop subpel search | 161 // Control when to stop subpel search |
151 int subpel_force_stop; | 162 int subpel_force_stop; |
| 163 } MV_SPEED_FEATURES; |
152 | 164 |
153 // This parameter controls the number of steps we'll do in a diamond | 165 typedef struct SPEED_FEATURES { |
154 // search. | 166 MV_SPEED_FEATURES mv; |
155 int max_step_search_steps; | |
156 | 167 |
157 // This parameter controls which step in the n-step process we start at. | 168 // Frame level coding parameter update |
158 // It's changed adaptively based on circumstances. | 169 int frame_parameter_update; |
159 int reduce_first_step_size; | |
160 | 170 |
161 // If this is set to 1, we limit the motion search range to 2 times the | 171 RECODE_LOOP_TYPE recode_loop; |
162 // largest motion vector found in the last frame. | |
163 int auto_mv_step_size; | |
164 | 172 |
165 // Trellis (dynamic programming) optimization of quantized values (+1, 0). | 173 // Trellis (dynamic programming) optimization of quantized values (+1, 0). |
166 int optimize_coefficients; | 174 int optimize_coefficients; |
167 | 175 |
168 // Always set to 0. If on it enables 0 cost background transmission | 176 // Always set to 0. If on it enables 0 cost background transmission |
169 // (except for the initial transmission of the segmentation). The feature is | 177 // (except for the initial transmission of the segmentation). The feature is |
170 // disabled because the addition of very large block sizes make the | 178 // disabled because the addition of very large block sizes make the |
171 // backgrounds very to cheap to encode, and the segmentation we have | 179 // backgrounds very to cheap to encode, and the segmentation we have |
172 // adds overhead. | 180 // adds overhead. |
173 int static_segmentation; | 181 int static_segmentation; |
(...skipping 19 matching lines...) Expand all Loading... |
193 | 201 |
194 // This variable allows us to reuse the last frames partition choices | 202 // This variable allows us to reuse the last frames partition choices |
195 // (64x64 v 32x32 etc) for this frame. It can be set to only use the last | 203 // (64x64 v 32x32 etc) for this frame. It can be set to only use the last |
196 // frame as a starting point in low motion scenes or always use it. If set | 204 // frame as a starting point in low motion scenes or always use it. If set |
197 // we use last partitioning_redo frequency to determine how often to redo | 205 // we use last partitioning_redo frequency to determine how often to redo |
198 // the partitioning from scratch. Adjust_partitioning_from_last_frame | 206 // the partitioning from scratch. Adjust_partitioning_from_last_frame |
199 // enables us to adjust up or down one partitioning from the last frames | 207 // enables us to adjust up or down one partitioning from the last frames |
200 // partitioning. | 208 // partitioning. |
201 LAST_FRAME_PARTITION_METHOD use_lastframe_partitioning; | 209 LAST_FRAME_PARTITION_METHOD use_lastframe_partitioning; |
202 | 210 |
| 211 // The threshold is to determine how slow the motino is, it is used when |
| 212 // use_lastframe_partitioning is set to LAST_FRAME_PARTITION_LOW_MOTION |
| 213 MOTION_THRESHOLD lf_motion_threshold; |
| 214 |
203 // Determine which method we use to determine transform size. We can choose | 215 // Determine which method we use to determine transform size. We can choose |
204 // between options like full rd, largest for prediction size, largest | 216 // between options like full rd, largest for prediction size, largest |
205 // for intra and model coefs for the rest. | 217 // for intra and model coefs for the rest. |
206 TX_SIZE_SEARCH_METHOD tx_size_search_method; | 218 TX_SIZE_SEARCH_METHOD tx_size_search_method; |
207 | 219 |
208 // Low precision 32x32 fdct keeps everything in 16 bits and thus is less | 220 // Low precision 32x32 fdct keeps everything in 16 bits and thus is less |
209 // precise but significantly faster than the non lp version. | 221 // precise but significantly faster than the non lp version. |
210 int use_lp32x32fdct; | 222 int use_lp32x32fdct; |
211 | 223 |
212 // TODO(JBB): remove this as its no longer used. | 224 // TODO(JBB): remove this as its no longer used. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // Allows sub 8x8 modes to use the prediction filter that was determined | 279 // Allows sub 8x8 modes to use the prediction filter that was determined |
268 // best for 8x8 mode. If set to 0 we always re check all the filters for | 280 // best for 8x8 mode. If set to 0 we always re check all the filters for |
269 // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter | 281 // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter |
270 // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. | 282 // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected. |
271 int adaptive_pred_interp_filter; | 283 int adaptive_pred_interp_filter; |
272 | 284 |
273 // Search through variable block partition types in non-RD mode decision | 285 // Search through variable block partition types in non-RD mode decision |
274 // encoding process for RTC. | 286 // encoding process for RTC. |
275 int partition_check; | 287 int partition_check; |
276 | 288 |
277 // Chessboard pattern index | |
278 int chessboard_index; | |
279 | |
280 // Use finer quantizer in every other few frames that run variable block | 289 // Use finer quantizer in every other few frames that run variable block |
281 // partition type search. | 290 // partition type search. |
282 int force_frame_boost; | 291 int force_frame_boost; |
283 | 292 |
284 // Maximally allowed base quantization index fluctuation. | 293 // Maximally allowed base quantization index fluctuation. |
285 int max_delta_qindex; | 294 int max_delta_qindex; |
286 | 295 |
287 // Implements various heuristics to skip searching modes | 296 // Implements various heuristics to skip searching modes |
288 // The heuristics selected are based on flags | 297 // The heuristics selected are based on flags |
289 // defined in the MODE_SEARCH_SKIP_HEURISTICS enum | 298 // defined in the MODE_SEARCH_SKIP_HEURISTICS enum |
(...skipping 24 matching lines...) Expand all Loading... |
314 // This feature controls how the loop filter level is determined. | 323 // This feature controls how the loop filter level is determined. |
315 LPF_PICK_METHOD lpf_pick; | 324 LPF_PICK_METHOD lpf_pick; |
316 | 325 |
317 // This feature limits the number of coefficients updates we actually do | 326 // This feature limits the number of coefficients updates we actually do |
318 // by only looking at counts from 1/2 the bands. | 327 // by only looking at counts from 1/2 the bands. |
319 FAST_COEFF_UPDATE use_fast_coef_updates; | 328 FAST_COEFF_UPDATE use_fast_coef_updates; |
320 | 329 |
321 // This flag controls the use of non-RD mode decision. | 330 // This flag controls the use of non-RD mode decision. |
322 int use_nonrd_pick_mode; | 331 int use_nonrd_pick_mode; |
323 | 332 |
324 // This variable sets the encode_breakout threshold. Currently, it is only | |
325 // enabled in real time mode. | |
326 int encode_breakout_thresh; | |
327 | |
328 // A binary mask indicating if NEARESTMV, NEARMV, ZEROMV, NEWMV | 333 // A binary mask indicating if NEARESTMV, NEARMV, ZEROMV, NEWMV |
329 // modes are disabled in order from LSB to MSB for each BLOCK_SIZE. | 334 // modes are used in order from LSB to MSB for each BLOCK_SIZE. |
330 int disable_inter_mode_mask[BLOCK_SIZES]; | 335 int inter_mode_mask[BLOCK_SIZES]; |
331 | 336 |
332 // This feature controls whether we do the expensive context update and | 337 // This feature controls whether we do the expensive context update and |
333 // calculation in the rd coefficient costing loop. | 338 // calculation in the rd coefficient costing loop. |
334 int use_fast_coef_costing; | 339 int use_fast_coef_costing; |
335 | 340 |
336 // This feature controls the tolerence vs target used in deciding whether to | 341 // This feature controls the tolerence vs target used in deciding whether to |
337 // recode a frame. It has no meaning if recode is disabled. | 342 // recode a frame. It has no meaning if recode is disabled. |
338 int recode_tolerance; | 343 int recode_tolerance; |
339 | 344 |
340 // This variable controls the maximum block size where intra blocks can be | 345 // This variable controls the maximum block size where intra blocks can be |
(...skipping 12 matching lines...) Expand all Loading... |
353 struct VP9_COMP; | 358 struct VP9_COMP; |
354 | 359 |
355 void vp9_set_speed_features(struct VP9_COMP *cpi); | 360 void vp9_set_speed_features(struct VP9_COMP *cpi); |
356 | 361 |
357 #ifdef __cplusplus | 362 #ifdef __cplusplus |
358 } // extern "C" | 363 } // extern "C" |
359 #endif | 364 #endif |
360 | 365 |
361 #endif // VP9_ENCODER_VP9_SPEED_FEATURES_H_ | 366 #endif // VP9_ENCODER_VP9_SPEED_FEATURES_H_ |
362 | 367 |
OLD | NEW |