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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 SUBPEL_TREE_PRUNED_EVENMORE = 3, // Prunes 1/2- and 1/4-pel searches | 86 SUBPEL_TREE_PRUNED_EVENMORE = 3, // Prunes 1/2- and 1/4-pel searches |
87 // Other methods to come | 87 // Other methods to come |
88 } SUBPEL_SEARCH_METHODS; | 88 } SUBPEL_SEARCH_METHODS; |
89 | 89 |
90 typedef enum { | 90 typedef enum { |
91 NO_MOTION_THRESHOLD = 0, | 91 NO_MOTION_THRESHOLD = 0, |
92 LOW_MOTION_THRESHOLD = 7 | 92 LOW_MOTION_THRESHOLD = 7 |
93 } MOTION_THRESHOLD; | 93 } MOTION_THRESHOLD; |
94 | 94 |
95 typedef enum { | 95 typedef enum { |
96 LAST_FRAME_PARTITION_OFF = 0, | |
97 LAST_FRAME_PARTITION_LOW_MOTION = 1, | |
98 LAST_FRAME_PARTITION_ALL = 2 | |
99 } LAST_FRAME_PARTITION_METHOD; | |
100 | |
101 typedef enum { | |
102 USE_FULL_RD = 0, | 96 USE_FULL_RD = 0, |
103 USE_LARGESTALL, | 97 USE_LARGESTALL, |
104 USE_TX_8X8 | 98 USE_TX_8X8 |
105 } TX_SIZE_SEARCH_METHOD; | 99 } TX_SIZE_SEARCH_METHOD; |
106 | 100 |
107 typedef enum { | 101 typedef enum { |
108 NOT_IN_USE = 0, | 102 NOT_IN_USE = 0, |
109 RELAXED_NEIGHBORING_MIN_MAX = 1, | 103 RELAXED_NEIGHBORING_MIN_MAX = 1, |
110 CONSTRAIN_NEIGHBORING_MIN_MAX = 2, | 104 CONSTRAIN_NEIGHBORING_MIN_MAX = 2, |
111 STRICT_NEIGHBORING_MIN_MAX = 3 | 105 STRICT_NEIGHBORING_MIN_MAX = 3 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 229 |
236 // Enables skipping the reconstruction step (idct, recon) in the | 230 // Enables skipping the reconstruction step (idct, recon) in the |
237 // intermediate steps assuming the last frame didn't have too many intra | 231 // intermediate steps assuming the last frame didn't have too many intra |
238 // blocks and the q is less than a threshold. | 232 // blocks and the q is less than a threshold. |
239 int skip_encode_sb; | 233 int skip_encode_sb; |
240 int skip_encode_frame; | 234 int skip_encode_frame; |
241 // Speed feature to allow or disallow skipping of recode at block | 235 // Speed feature to allow or disallow skipping of recode at block |
242 // level within a frame. | 236 // level within a frame. |
243 int allow_skip_recode; | 237 int allow_skip_recode; |
244 | 238 |
245 // This variable allows us to reuse the last frames partition choices | |
246 // (64x64 v 32x32 etc) for this frame. It can be set to only use the last | |
247 // frame as a starting point in low motion scenes or always use it. If set | |
248 // we use last partitioning_redo frequency to determine how often to redo | |
249 // the partitioning from scratch. Adjust_partitioning_from_last_frame | |
250 // enables us to adjust up or down one partitioning from the last frames | |
251 // partitioning. | |
252 LAST_FRAME_PARTITION_METHOD use_lastframe_partitioning; | |
253 | |
254 // The threshold is to determine how slow the motino is, it is used when | 239 // The threshold is to determine how slow the motino is, it is used when |
255 // use_lastframe_partitioning is set to LAST_FRAME_PARTITION_LOW_MOTION | 240 // use_lastframe_partitioning is set to LAST_FRAME_PARTITION_LOW_MOTION |
256 MOTION_THRESHOLD lf_motion_threshold; | 241 MOTION_THRESHOLD lf_motion_threshold; |
257 | 242 |
258 // Determine which method we use to determine transform size. We can choose | 243 // Determine which method we use to determine transform size. We can choose |
259 // between options like full rd, largest for prediction size, largest | 244 // between options like full rd, largest for prediction size, largest |
260 // for intra and model coefs for the rest. | 245 // for intra and model coefs for the rest. |
261 TX_SIZE_SEARCH_METHOD tx_size_search_method; | 246 TX_SIZE_SEARCH_METHOD tx_size_search_method; |
262 | 247 |
263 // Low precision 32x32 fdct keeps everything in 16 bits and thus is less | 248 // Low precision 32x32 fdct keeps everything in 16 bits and thus is less |
264 // precise but significantly faster than the non lp version. | 249 // precise but significantly faster than the non lp version. |
265 int use_lp32x32fdct; | 250 int use_lp32x32fdct; |
266 | 251 |
267 // TODO(JBB): remove this as its no longer used. | |
268 | |
269 // After looking at the first set of modes (set by index here), skip | 252 // After looking at the first set of modes (set by index here), skip |
270 // checking modes for reference frames that don't match the reference frame | 253 // checking modes for reference frames that don't match the reference frame |
271 // of the best so far. | 254 // of the best so far. |
272 int mode_skip_start; | 255 int mode_skip_start; |
273 | 256 |
274 // TODO(JBB): Remove this. | 257 // TODO(JBB): Remove this. |
275 int reference_masking; | 258 int reference_masking; |
276 | 259 |
277 PARTITION_SEARCH_TYPE partition_search_type; | 260 PARTITION_SEARCH_TYPE partition_search_type; |
278 | 261 |
279 // Used if partition_search_type = FIXED_SIZE_PARTITION | 262 // Used if partition_search_type = FIXED_SIZE_PARTITION |
280 BLOCK_SIZE always_this_block_size; | 263 BLOCK_SIZE always_this_block_size; |
281 | 264 |
282 // Skip rectangular partition test when partition type none gives better | 265 // Skip rectangular partition test when partition type none gives better |
283 // rd than partition type split. | 266 // rd than partition type split. |
284 int less_rectangular_check; | 267 int less_rectangular_check; |
285 | 268 |
286 // Disable testing non square partitions. (eg 16x32) | 269 // Disable testing non square partitions. (eg 16x32) |
287 int use_square_partition_only; | 270 int use_square_partition_only; |
288 | 271 |
289 // Sets min and max partition sizes for this 64x64 region based on the | 272 // Sets min and max partition sizes for this 64x64 region based on the |
290 // same 64x64 in last encoded frame, and the left and above neighbor. | 273 // same 64x64 in last encoded frame, and the left and above neighbor. |
291 AUTO_MIN_MAX_MODE auto_min_max_partition_size; | 274 AUTO_MIN_MAX_MODE auto_min_max_partition_size; |
292 | 275 |
293 // Min and max partition size we enable (block_size) as per auto | 276 // Min and max partition size we enable (block_size) as per auto |
294 // min max, but also used by adjust partitioning, and pick_partitioning. | 277 // min max, but also used by adjust partitioning, and pick_partitioning. |
295 BLOCK_SIZE min_partition_size; | 278 BLOCK_SIZE default_min_partition_size; |
296 BLOCK_SIZE max_partition_size; | 279 BLOCK_SIZE default_max_partition_size; |
297 | 280 |
298 // Whether or not we allow partitions one smaller or one greater than the last | 281 // Whether or not we allow partitions one smaller or one greater than the last |
299 // frame's partitioning. Only used if use_lastframe_partitioning is set. | 282 // frame's partitioning. Only used if use_lastframe_partitioning is set. |
300 int adjust_partitioning_from_last_frame; | 283 int adjust_partitioning_from_last_frame; |
301 | 284 |
302 // How frequently we re do the partitioning from scratch. Only used if | 285 // How frequently we re do the partitioning from scratch. Only used if |
303 // use_lastframe_partitioning is set. | 286 // use_lastframe_partitioning is set. |
304 int last_partitioning_redo_frequency; | 287 int last_partitioning_redo_frequency; |
305 | 288 |
306 // This enables constrained copy partitioning, which, given an input block | |
307 // size bsize, will copy previous partition for partitions less than bsize, | |
308 // otherwise bsize partition is used. bsize is currently set to 16x16. | |
309 // Used for the case where motion is detected in superblock. | |
310 int constrain_copy_partition; | |
311 | |
312 // Disables sub 8x8 blocksizes in different scenarios: Choices are to disable | 289 // Disables sub 8x8 blocksizes in different scenarios: Choices are to disable |
313 // it always, to allow it for only Last frame and Intra, disable it for all | 290 // it always, to allow it for only Last frame and Intra, disable it for all |
314 // inter modes or to enable it always. | 291 // inter modes or to enable it always. |
315 int disable_split_mask; | 292 int disable_split_mask; |
316 | 293 |
317 // TODO(jingning): combine the related motion search speed features | 294 // TODO(jingning): combine the related motion search speed features |
318 // This allows us to use motion search at other sizes as a starting | 295 // This allows us to use motion search at other sizes as a starting |
319 // point for this motion search and limits the search range around it. | 296 // point for this motion search and limits the search range around it. |
320 int adaptive_motion_search; | 297 int adaptive_motion_search; |
321 | 298 |
(...skipping 13 matching lines...) Expand all Loading... |
335 | 312 |
336 int cb_partition_search; | 313 int cb_partition_search; |
337 | 314 |
338 int motion_field_mode_search; | 315 int motion_field_mode_search; |
339 | 316 |
340 int alt_ref_search_fp; | 317 int alt_ref_search_fp; |
341 | 318 |
342 // Fast quantization process path | 319 // Fast quantization process path |
343 int use_quant_fp; | 320 int use_quant_fp; |
344 | 321 |
345 // Search through variable block partition types in non-RD mode decision | |
346 // encoding process for RTC. | |
347 int partition_check; | |
348 | |
349 // Use finer quantizer in every other few frames that run variable block | 322 // Use finer quantizer in every other few frames that run variable block |
350 // partition type search. | 323 // partition type search. |
351 int force_frame_boost; | 324 int force_frame_boost; |
352 | 325 |
353 // Maximally allowed base quantization index fluctuation. | 326 // Maximally allowed base quantization index fluctuation. |
354 int max_delta_qindex; | 327 int max_delta_qindex; |
355 | 328 |
356 // Implements various heuristics to skip searching modes | 329 // Implements various heuristics to skip searching modes |
357 // The heuristics selected are based on flags | 330 // The heuristics selected are based on flags |
358 // defined in the MODE_SEARCH_SKIP_HEURISTICS enum | 331 // defined in the MODE_SEARCH_SKIP_HEURISTICS enum |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // Partition search early breakout thresholds. | 409 // Partition search early breakout thresholds. |
437 int64_t partition_search_breakout_dist_thr; | 410 int64_t partition_search_breakout_dist_thr; |
438 int partition_search_breakout_rate_thr; | 411 int partition_search_breakout_rate_thr; |
439 | 412 |
440 // Allow skipping partition search for still image frame | 413 // Allow skipping partition search for still image frame |
441 int allow_partition_search_skip; | 414 int allow_partition_search_skip; |
442 } SPEED_FEATURES; | 415 } SPEED_FEATURES; |
443 | 416 |
444 struct VP9_COMP; | 417 struct VP9_COMP; |
445 | 418 |
446 void vp9_set_speed_features(struct VP9_COMP *cpi); | 419 void vp9_set_speed_features_framesize_independent(struct VP9_COMP *cpi); |
| 420 void vp9_set_speed_features_framesize_dependent(struct VP9_COMP *cpi); |
447 | 421 |
448 #ifdef __cplusplus | 422 #ifdef __cplusplus |
449 } // extern "C" | 423 } // extern "C" |
450 #endif | 424 #endif |
451 | 425 |
452 #endif // VP9_ENCODER_VP9_SPEED_FEATURES_H_ | 426 #endif // VP9_ENCODER_VP9_SPEED_FEATURES_H_ |
453 | 427 |
OLD | NEW |