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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return BLOCK_16X16; | 42 return BLOCK_16X16; |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 static void set_good_speed_feature_framesize_dependent(VP9_COMP *cpi, | 46 static void set_good_speed_feature_framesize_dependent(VP9_COMP *cpi, |
47 SPEED_FEATURES *sf, | 47 SPEED_FEATURES *sf, |
48 int speed) { | 48 int speed) { |
49 VP9_COMMON *const cm = &cpi->common; | 49 VP9_COMMON *const cm = &cpi->common; |
50 | 50 |
51 if (speed >= 1) { | 51 if (speed >= 1) { |
52 if (MIN(cm->width, cm->height) >= 720) { | 52 if (VPXMIN(cm->width, cm->height) >= 720) { |
53 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT | 53 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT |
54 : DISABLE_ALL_INTER_SPLIT; | 54 : DISABLE_ALL_INTER_SPLIT; |
55 sf->partition_search_breakout_dist_thr = (1 << 23); | 55 sf->partition_search_breakout_dist_thr = (1 << 23); |
56 } else { | 56 } else { |
57 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; | 57 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; |
58 sf->partition_search_breakout_dist_thr = (1 << 21); | 58 sf->partition_search_breakout_dist_thr = (1 << 21); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 if (speed >= 2) { | 62 if (speed >= 2) { |
63 if (MIN(cm->width, cm->height) >= 720) { | 63 if (VPXMIN(cm->width, cm->height) >= 720) { |
64 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT | 64 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT |
65 : DISABLE_ALL_INTER_SPLIT; | 65 : DISABLE_ALL_INTER_SPLIT; |
66 sf->adaptive_pred_interp_filter = 0; | 66 sf->adaptive_pred_interp_filter = 0; |
67 sf->partition_search_breakout_dist_thr = (1 << 24); | 67 sf->partition_search_breakout_dist_thr = (1 << 24); |
68 sf->partition_search_breakout_rate_thr = 120; | 68 sf->partition_search_breakout_rate_thr = 120; |
69 } else { | 69 } else { |
70 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; | 70 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; |
71 sf->partition_search_breakout_dist_thr = (1 << 22); | 71 sf->partition_search_breakout_dist_thr = (1 << 22); |
72 sf->partition_search_breakout_rate_thr = 100; | 72 sf->partition_search_breakout_rate_thr = 100; |
73 } | 73 } |
74 sf->rd_auto_partition_min_limit = set_partition_min_limit(cm); | 74 sf->rd_auto_partition_min_limit = set_partition_min_limit(cm); |
75 } | 75 } |
76 | 76 |
77 if (speed >= 3) { | 77 if (speed >= 3) { |
78 if (MIN(cm->width, cm->height) >= 720) { | 78 if (VPXMIN(cm->width, cm->height) >= 720) { |
79 sf->disable_split_mask = DISABLE_ALL_SPLIT; | 79 sf->disable_split_mask = DISABLE_ALL_SPLIT; |
80 sf->schedule_mode_search = cm->base_qindex < 220 ? 1 : 0; | 80 sf->schedule_mode_search = cm->base_qindex < 220 ? 1 : 0; |
81 sf->partition_search_breakout_dist_thr = (1 << 25); | 81 sf->partition_search_breakout_dist_thr = (1 << 25); |
82 sf->partition_search_breakout_rate_thr = 200; | 82 sf->partition_search_breakout_rate_thr = 200; |
83 } else { | 83 } else { |
84 sf->max_intra_bsize = BLOCK_32X32; | 84 sf->max_intra_bsize = BLOCK_32X32; |
85 sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT; | 85 sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT; |
86 sf->schedule_mode_search = cm->base_qindex < 175 ? 1 : 0; | 86 sf->schedule_mode_search = cm->base_qindex < 175 ? 1 : 0; |
87 sf->partition_search_breakout_dist_thr = (1 << 23); | 87 sf->partition_search_breakout_dist_thr = (1 << 23); |
88 sf->partition_search_breakout_rate_thr = 120; | 88 sf->partition_search_breakout_rate_thr = 120; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 // If this is a two pass clip that fits the criteria for animated or | 92 // If this is a two pass clip that fits the criteria for animated or |
93 // graphics content then reset disable_split_mask for speeds 1-4. | 93 // graphics content then reset disable_split_mask for speeds 1-4. |
94 // Also if the image edge is internal to the coded area. | 94 // Also if the image edge is internal to the coded area. |
95 if ((speed >= 1) && (cpi->oxcf.pass == 2) && | 95 if ((speed >= 1) && (cpi->oxcf.pass == 2) && |
96 ((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) || | 96 ((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) || |
97 (vp9_internal_image_edge(cpi)))) { | 97 (vp9_internal_image_edge(cpi)))) { |
98 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; | 98 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; |
99 } | 99 } |
100 | 100 |
101 if (speed >= 4) { | 101 if (speed >= 4) { |
102 if (MIN(cm->width, cm->height) >= 720) { | 102 if (VPXMIN(cm->width, cm->height) >= 720) { |
103 sf->partition_search_breakout_dist_thr = (1 << 26); | 103 sf->partition_search_breakout_dist_thr = (1 << 26); |
104 } else { | 104 } else { |
105 sf->partition_search_breakout_dist_thr = (1 << 24); | 105 sf->partition_search_breakout_dist_thr = (1 << 24); |
106 } | 106 } |
107 sf->disable_split_mask = DISABLE_ALL_SPLIT; | 107 sf->disable_split_mask = DISABLE_ALL_SPLIT; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm, | 111 static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm, |
112 SPEED_FEATURES *sf, int speed) { | 112 SPEED_FEATURES *sf, int speed) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 sf->mv.reduce_first_step_size = 1; | 208 sf->mv.reduce_first_step_size = 1; |
209 sf->simple_model_rd_from_var = 1; | 209 sf->simple_model_rd_from_var = 1; |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 static void set_rt_speed_feature_framesize_dependent(VP9_COMP *cpi, | 213 static void set_rt_speed_feature_framesize_dependent(VP9_COMP *cpi, |
214 SPEED_FEATURES *sf, int speed) { | 214 SPEED_FEATURES *sf, int speed) { |
215 VP9_COMMON *const cm = &cpi->common; | 215 VP9_COMMON *const cm = &cpi->common; |
216 | 216 |
217 if (speed >= 1) { | 217 if (speed >= 1) { |
218 if (MIN(cm->width, cm->height) >= 720) { | 218 if (VPXMIN(cm->width, cm->height) >= 720) { |
219 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT | 219 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT |
220 : DISABLE_ALL_INTER_SPLIT; | 220 : DISABLE_ALL_INTER_SPLIT; |
221 } else { | 221 } else { |
222 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; | 222 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; |
223 } | 223 } |
224 } | 224 } |
225 | 225 |
226 if (speed >= 2) { | 226 if (speed >= 2) { |
227 if (MIN(cm->width, cm->height) >= 720) { | 227 if (VPXMIN(cm->width, cm->height) >= 720) { |
228 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT | 228 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT |
229 : DISABLE_ALL_INTER_SPLIT; | 229 : DISABLE_ALL_INTER_SPLIT; |
230 } else { | 230 } else { |
231 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; | 231 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 if (speed >= 5) { | 235 if (speed >= 5) { |
236 if (MIN(cm->width, cm->height) >= 720) { | 236 if (VPXMIN(cm->width, cm->height) >= 720) { |
237 sf->partition_search_breakout_dist_thr = (1 << 25); | 237 sf->partition_search_breakout_dist_thr = (1 << 25); |
238 } else { | 238 } else { |
239 sf->partition_search_breakout_dist_thr = (1 << 23); | 239 sf->partition_search_breakout_dist_thr = (1 << 23); |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
243 if (speed >= 7) { | 243 if (speed >= 7) { |
244 sf->encode_breakout_thresh = (MIN(cm->width, cm->height) >= 720) ? | 244 sf->encode_breakout_thresh = (VPXMIN(cm->width, cm->height) >= 720) ? |
245 800 : 300; | 245 800 : 300; |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, | 249 static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, |
250 int speed, vp9e_tune_content content) { | 250 int speed, vp9e_tune_content content) { |
251 VP9_COMMON *const cm = &cpi->common; | 251 VP9_COMMON *const cm = &cpi->common; |
252 const int is_keyframe = cm->frame_type == KEY_FRAME; | 252 const int is_keyframe = cm->frame_type == KEY_FRAME; |
253 const int frames_since_key = is_keyframe ? 0 : cpi->rc.frames_since_key; | 253 const int frames_since_key = is_keyframe ? 0 : cpi->rc.frames_since_key; |
254 sf->static_segmentation = 0; | 254 sf->static_segmentation = 0; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 sf->use_nonrd_pick_mode = 1; | 387 sf->use_nonrd_pick_mode = 1; |
388 sf->mv.search_method = NSTEP; | 388 sf->mv.search_method = NSTEP; |
389 sf->mv.reduce_first_step_size = 1; | 389 sf->mv.reduce_first_step_size = 1; |
390 sf->skip_encode_sb = 0; | 390 sf->skip_encode_sb = 0; |
391 } | 391 } |
392 | 392 |
393 if (speed >= 7) { | 393 if (speed >= 7) { |
394 sf->adaptive_rd_thresh = 3; | 394 sf->adaptive_rd_thresh = 3; |
395 sf->mv.search_method = FAST_DIAMOND; | 395 sf->mv.search_method = FAST_DIAMOND; |
396 sf->mv.fullpel_search_step_param = 10; | 396 sf->mv.fullpel_search_step_param = 10; |
| 397 if (cpi->svc.number_temporal_layers > 2 && |
| 398 cpi->svc.temporal_layer_id == 0) { |
| 399 sf->mv.search_method = NSTEP; |
| 400 sf->mv.fullpel_search_step_param = 6; |
| 401 } |
397 } | 402 } |
398 if (speed >= 8) { | 403 if (speed >= 8) { |
399 sf->adaptive_rd_thresh = 4; | 404 sf->adaptive_rd_thresh = 4; |
400 sf->mv.subpel_force_stop = 2; | 405 sf->mv.subpel_force_stop = 2; |
401 sf->lpf_pick = LPF_PICK_MINIMAL_LPF; | 406 sf->lpf_pick = LPF_PICK_MINIMAL_LPF; |
402 } | 407 } |
403 } | 408 } |
404 | 409 |
405 void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) { | 410 void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) { |
406 SPEED_FEATURES *const sf = &cpi->sf; | 411 SPEED_FEATURES *const sf = &cpi->sf; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 | 548 |
544 x->optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1; | 549 x->optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1; |
545 | 550 |
546 x->min_partition_size = sf->default_min_partition_size; | 551 x->min_partition_size = sf->default_min_partition_size; |
547 x->max_partition_size = sf->default_max_partition_size; | 552 x->max_partition_size = sf->default_max_partition_size; |
548 | 553 |
549 if (!cpi->oxcf.frame_periodic_boost) { | 554 if (!cpi->oxcf.frame_periodic_boost) { |
550 sf->max_delta_qindex = 0; | 555 sf->max_delta_qindex = 0; |
551 } | 556 } |
552 } | 557 } |
OLD | NEW |