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

Side by Side Diff: source/libvpx/vp9/encoder/vp9_speed_features.c

Issue 554673004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_speed_features.h ('k') | source/libvpx/vp9/encoder/vp9_ssim.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref) || 58 (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref) ||
59 vp9_is_upper_layer_key_frame(cpi); 59 vp9_is_upper_layer_key_frame(cpi);
60 } 60 }
61 61
62 62
63 static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm, 63 static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
64 SPEED_FEATURES *sf, int speed) { 64 SPEED_FEATURES *sf, int speed) {
65 const int boosted = frame_is_boosted(cpi); 65 const int boosted = frame_is_boosted(cpi);
66 66
67 sf->adaptive_rd_thresh = 1; 67 sf->adaptive_rd_thresh = 1;
68 sf->recode_loop = (speed < 1) ? ALLOW_RECODE : ALLOW_RECODE_KFMAXBW;
69 sf->allow_skip_recode = 1; 68 sf->allow_skip_recode = 1;
70 69
71 if (speed >= 1) { 70 if (speed >= 1) {
72 sf->use_square_partition_only = !frame_is_intra_only(cm); 71 sf->use_square_partition_only = !frame_is_intra_only(cm);
73 sf->less_rectangular_check = 1; 72 sf->less_rectangular_check = 1;
74 73
75 if (MIN(cm->width, cm->height) >= 720) 74 if (MIN(cm->width, cm->height) >= 720)
76 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT 75 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
77 : DISABLE_ALL_INTER_SPLIT; 76 : DISABLE_ALL_INTER_SPLIT;
78 else 77 else
79 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; 78 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT;
80 sf->use_rd_breakout = 1; 79 sf->use_rd_breakout = 1;
81 sf->adaptive_motion_search = 1; 80 sf->adaptive_motion_search = 1;
82 sf->mv.auto_mv_step_size = 1; 81 sf->mv.auto_mv_step_size = 1;
83 sf->adaptive_rd_thresh = 2; 82 sf->adaptive_rd_thresh = 2;
84 sf->mv.subpel_iters_per_step = 1; 83 sf->mv.subpel_iters_per_step = 1;
85 sf->mode_skip_start = 10; 84 sf->mode_skip_start = 10;
86 sf->adaptive_pred_interp_filter = 1; 85 sf->adaptive_pred_interp_filter = 1;
87 86
88 sf->recode_loop = ALLOW_RECODE_KFARFGF; 87 sf->recode_loop = ALLOW_RECODE_KFARFGF;
89 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; 88 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
90 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V; 89 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
91 sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V; 90 sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
92 sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V; 91 sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
93 92
94 sf->tx_size_search_breakout = 1; 93 sf->tx_size_search_breakout = 1;
94
95 if (MIN(cm->width, cm->height) >= 720)
96 sf->partition_search_breakout_dist_thr = (1 << 23);
97 else
98 sf->partition_search_breakout_dist_thr = (1 << 21);
99 sf->partition_search_breakout_rate_thr = 500;
95 } 100 }
96 101
97 if (speed >= 2) { 102 if (speed >= 2) {
98 sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD 103 sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD
99 : USE_LARGESTALL; 104 : USE_LARGESTALL;
100 105
101 if (MIN(cm->width, cm->height) >= 720) { 106 if (MIN(cm->width, cm->height) >= 720) {
102 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; 107 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
103 sf->last_partitioning_redo_frequency = 3; 108 sf->last_partitioning_redo_frequency = 3;
104 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT 109 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
105 : DISABLE_ALL_INTER_SPLIT; 110 : DISABLE_ALL_INTER_SPLIT;
106 sf->adaptive_pred_interp_filter = 0; 111 sf->adaptive_pred_interp_filter = 0;
107 } else { 112 } else {
108 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; 113 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
109 sf->last_partitioning_redo_frequency = 2; 114 sf->last_partitioning_redo_frequency = 2;
110 sf->lf_motion_threshold = NO_MOTION_THRESHOLD; 115 sf->lf_motion_threshold = NO_MOTION_THRESHOLD;
111 } 116 }
112 117
113 sf->reference_masking = 1; 118 sf->reference_masking = 1;
114 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH | 119 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
115 FLAG_SKIP_INTRA_BESTINTER | 120 FLAG_SKIP_INTRA_BESTINTER |
116 FLAG_SKIP_COMP_BESTINTRA | 121 FLAG_SKIP_COMP_BESTINTRA |
117 FLAG_SKIP_INTRA_LOWVAR; 122 FLAG_SKIP_INTRA_LOWVAR;
118 sf->disable_filter_search_var_thresh = 100; 123 sf->disable_filter_search_var_thresh = 100;
119 sf->comp_inter_joint_search_thresh = BLOCK_SIZES; 124 sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
120 sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX; 125 sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX;
121 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION; 126 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION;
122 sf->adjust_partitioning_from_last_frame = 1; 127 sf->adjust_partitioning_from_last_frame = 1;
128
129 if (MIN(cm->width, cm->height) >= 720)
130 sf->partition_search_breakout_dist_thr = (1 << 24);
131 else
132 sf->partition_search_breakout_dist_thr = (1 << 22);
133 sf->partition_search_breakout_rate_thr = 700;
123 } 134 }
124 135
125 if (speed >= 3) { 136 if (speed >= 3) {
126 sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD 137 sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD
127 : USE_LARGESTALL; 138 : USE_LARGESTALL;
128 if (MIN(cm->width, cm->height) >= 720) { 139 if (MIN(cm->width, cm->height) >= 720) {
129 sf->disable_split_mask = DISABLE_ALL_SPLIT; 140 sf->disable_split_mask = DISABLE_ALL_SPLIT;
130 } else { 141 } else {
131 sf->max_intra_bsize = BLOCK_32X32; 142 sf->max_intra_bsize = BLOCK_32X32;
132 sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT; 143 sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
133 } 144 }
134 sf->adaptive_pred_interp_filter = 0; 145 sf->adaptive_pred_interp_filter = 0;
146 sf->adaptive_mode_search = 1;
135 sf->cb_partition_search = !boosted; 147 sf->cb_partition_search = !boosted;
136 sf->cb_pred_filter_search = 1; 148 sf->cb_pred_filter_search = 1;
137 sf->alt_ref_search_fp = 1; 149 sf->alt_ref_search_fp = 1;
138 sf->motion_field_mode_search = !boosted; 150 sf->motion_field_mode_search = !boosted;
139 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; 151 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
140 sf->last_partitioning_redo_frequency = 3; 152 sf->last_partitioning_redo_frequency = 2;
141 sf->recode_loop = ALLOW_RECODE_KFMAXBW; 153 sf->recode_loop = ALLOW_RECODE_KFMAXBW;
142 sf->adaptive_rd_thresh = 3; 154 sf->adaptive_rd_thresh = 3;
143 sf->mode_skip_start = 6; 155 sf->mode_skip_start = 6;
144 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC; 156 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC;
145 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC; 157 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC;
158 sf->adaptive_interp_filter_search = 1;
159
160 if (MIN(cm->width, cm->height) >= 720)
161 sf->partition_search_breakout_dist_thr = (1 << 25);
162 else
163 sf->partition_search_breakout_dist_thr = (1 << 23);
164 sf->partition_search_breakout_rate_thr = 1000;
146 } 165 }
147 166
148 if (speed >= 4) { 167 if (speed >= 4) {
149 sf->use_square_partition_only = 1; 168 sf->use_square_partition_only = 1;
150 sf->tx_size_search_method = USE_LARGESTALL; 169 sf->tx_size_search_method = USE_LARGESTALL;
151 sf->disable_split_mask = DISABLE_ALL_SPLIT; 170 sf->disable_split_mask = DISABLE_ALL_SPLIT;
152 sf->adaptive_rd_thresh = 4; 171 sf->adaptive_rd_thresh = 4;
153 sf->mode_search_skip_flags |= FLAG_SKIP_COMP_REFMISMATCH | 172 sf->mode_search_skip_flags |= FLAG_SKIP_COMP_REFMISMATCH |
154 FLAG_EARLY_TERMINATE; 173 FLAG_EARLY_TERMINATE;
155 sf->disable_filter_search_var_thresh = 200; 174 sf->disable_filter_search_var_thresh = 200;
156 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL; 175 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL;
157 sf->use_lp32x32fdct = 1; 176 sf->use_lp32x32fdct = 1;
158 sf->use_fast_coef_updates = ONE_LOOP_REDUCED; 177 sf->use_fast_coef_updates = ONE_LOOP_REDUCED;
159 sf->use_fast_coef_costing = 1; 178 sf->use_fast_coef_costing = 1;
179
180 if (MIN(cm->width, cm->height) >= 720)
181 sf->partition_search_breakout_dist_thr = (1 << 26);
182 else
183 sf->partition_search_breakout_dist_thr = (1 << 24);
184 sf->partition_search_breakout_rate_thr = 1500;
160 } 185 }
161 186
162 if (speed >= 5) { 187 if (speed >= 5) {
163 int i; 188 int i;
164 189
165 sf->partition_search_type = FIXED_PARTITION; 190 sf->partition_search_type = FIXED_PARTITION;
166 sf->optimize_coefficients = 0; 191 sf->optimize_coefficients = 0;
167 sf->mv.search_method = HEX; 192 sf->mv.search_method = HEX;
168 sf->disable_filter_search_var_thresh = 500; 193 sf->disable_filter_search_var_thresh = 500;
169 for (i = 0; i < TX_SIZES; ++i) { 194 for (i = 0; i < TX_SIZES; ++i) {
170 sf->intra_y_mode_mask[i] = INTRA_DC; 195 sf->intra_y_mode_mask[i] = INTRA_DC;
171 sf->intra_uv_mode_mask[i] = INTRA_DC; 196 sf->intra_uv_mode_mask[i] = INTRA_DC;
172 } 197 }
173 cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; 198 cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
174 } 199 }
175 if (speed >= 6) { 200 if (speed >= 6) {
176 sf->mv.reduce_first_step_size = 1; 201 sf->mv.reduce_first_step_size = 1;
177 } 202 }
178 } 203 }
179 204
180 static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, 205 static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
181 int speed, vp9e_tune_content content) { 206 int speed, vp9e_tune_content content) {
182 VP9_COMMON *const cm = &cpi->common; 207 VP9_COMMON *const cm = &cpi->common;
183 const int frames_since_key = 208 const int is_keyframe = cm->frame_type == KEY_FRAME;
184 cm->frame_type == KEY_FRAME ? 0 : cpi->rc.frames_since_key; 209 const int frames_since_key = is_keyframe ? 0 : cpi->rc.frames_since_key;
185 sf->static_segmentation = 0; 210 sf->static_segmentation = 0;
186 sf->adaptive_rd_thresh = 1; 211 sf->adaptive_rd_thresh = 1;
187 sf->use_fast_coef_costing = 1; 212 sf->use_fast_coef_costing = 1;
188 213
189 if (speed >= 1) { 214 if (speed >= 1) {
190 sf->use_square_partition_only = !frame_is_intra_only(cm); 215 sf->use_square_partition_only = !frame_is_intra_only(cm);
191 sf->less_rectangular_check = 1; 216 sf->less_rectangular_check = 1;
192 sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD 217 sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD
193 : USE_LARGESTALL; 218 : USE_LARGESTALL;
194 219
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 sf->mv.search_method = FAST_HEX; 295 sf->mv.search_method = FAST_HEX;
271 sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEAR_NEW; 296 sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEAR_NEW;
272 sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST; 297 sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST;
273 sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST; 298 sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST;
274 sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST; 299 sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST;
275 sf->max_intra_bsize = BLOCK_32X32; 300 sf->max_intra_bsize = BLOCK_32X32;
276 sf->allow_skip_recode = 1; 301 sf->allow_skip_recode = 1;
277 } 302 }
278 303
279 if (speed >= 5) { 304 if (speed >= 5) {
280 sf->use_quant_fp = cm->frame_type == KEY_FRAME ? 0 : 1; 305 sf->use_quant_fp = !is_keyframe;
281 sf->auto_min_max_partition_size = (cm->frame_type == KEY_FRAME) ? 306 sf->auto_min_max_partition_size = is_keyframe ? RELAXED_NEIGHBORING_MIN_MAX
282 RELAXED_NEIGHBORING_MIN_MAX : STRICT_NEIGHBORING_MIN_MAX; 307 : STRICT_NEIGHBORING_MIN_MAX;
283 sf->max_partition_size = BLOCK_32X32; 308 sf->max_partition_size = BLOCK_32X32;
284 sf->min_partition_size = BLOCK_8X8; 309 sf->min_partition_size = BLOCK_8X8;
285 sf->partition_check = 310 sf->partition_check =
286 (frames_since_key % sf->last_partitioning_redo_frequency == 1); 311 (frames_since_key % sf->last_partitioning_redo_frequency == 1);
287 sf->force_frame_boost = cm->frame_type == KEY_FRAME || 312 sf->force_frame_boost = is_keyframe ||
288 (frames_since_key % 313 (frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1);
289 (sf->last_partitioning_redo_frequency << 1) == 1); 314 sf->max_delta_qindex = is_keyframe ? 20 : 15;
290 sf->max_delta_qindex = (cm->frame_type == KEY_FRAME) ? 20 : 15;
291 sf->partition_search_type = REFERENCE_PARTITION; 315 sf->partition_search_type = REFERENCE_PARTITION;
292 sf->use_nonrd_pick_mode = 1; 316 sf->use_nonrd_pick_mode = 1;
293 sf->allow_skip_recode = 0; 317 sf->allow_skip_recode = 0;
294 } 318 }
295 319
296 if (speed >= 6) { 320 if (speed >= 6) {
297 if (content == VP9E_CONTENT_SCREEN) { 321 if (content == VP9E_CONTENT_SCREEN) {
298 int i; 322 int i;
299 // Allow fancy modes at all sizes since SOURCE_VAR_BASED_PARTITION is used 323 // Allow fancy modes at all sizes since SOURCE_VAR_BASED_PARTITION is used
300 for (i = 0; i < BLOCK_SIZES; ++i) 324 for (i = 0; i < BLOCK_SIZES; ++i)
301 sf->inter_mode_mask[i] = INTER_ALL; 325 sf->inter_mode_mask[i] = INTER_ALL;
302 } 326 }
303 327
304 // Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION. 328 // Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION.
305 sf->partition_search_type = SOURCE_VAR_BASED_PARTITION; 329 sf->partition_search_type = SOURCE_VAR_BASED_PARTITION;
306 sf->search_type_check_frequency = 50; 330 sf->search_type_check_frequency = 50;
307 331
308 sf->tx_size_search_method = (cm->frame_type == KEY_FRAME) ? 332 sf->tx_size_search_method = is_keyframe ? USE_LARGESTALL : USE_TX_8X8;
309 USE_LARGESTALL : USE_TX_8X8;
310 333
311 // This feature is only enabled when partition search is disabled. 334 // This feature is only enabled when partition search is disabled.
312 sf->reuse_inter_pred_sby = 1; 335 sf->reuse_inter_pred_sby = 1;
313 336
314 // Increase mode checking threshold for NEWMV. 337 // Increase mode checking threshold for NEWMV.
315 sf->elevate_newmv_thresh = 2000; 338 sf->elevate_newmv_thresh = 2000;
316 339
317 sf->mv.reduce_first_step_size = 1; 340 sf->mv.reduce_first_step_size = 1;
318 } 341 }
342
319 if (speed >= 7) { 343 if (speed >= 7) {
320 sf->mv.search_method = FAST_DIAMOND; 344 sf->mv.search_method = FAST_DIAMOND;
321 sf->mv.fullpel_search_step_param = 10; 345 sf->mv.fullpel_search_step_param = 10;
322 sf->lpf_pick = LPF_PICK_MINIMAL_LPF; 346 sf->lpf_pick = LPF_PICK_MINIMAL_LPF;
323 sf->encode_breakout_thresh = (MIN(cm->width, cm->height) >= 720) ? 347 sf->encode_breakout_thresh = (MIN(cm->width, cm->height) >= 720) ?
324 800 : 300; 348 800 : 300;
325 sf->elevate_newmv_thresh = 2500; 349 sf->elevate_newmv_thresh = 2500;
326 } 350 }
351
327 if (speed >= 12) { 352 if (speed >= 12) {
328 sf->elevate_newmv_thresh = 4000; 353 sf->elevate_newmv_thresh = 4000;
329 sf->mv.subpel_force_stop = 2; 354 sf->mv.subpel_force_stop = 2;
330 } 355 }
356
331 if (speed >= 13) { 357 if (speed >= 13) {
332 int i; 358 int i;
333 sf->max_intra_bsize = BLOCK_32X32; 359 sf->max_intra_bsize = BLOCK_32X32;
334 for (i = 0; i < BLOCK_SIZES; ++i) 360 for (i = 0; i < BLOCK_SIZES; ++i)
335 sf->inter_mode_mask[i] = INTER_NEAREST; 361 sf->inter_mode_mask[i] = INTER_NEAREST;
336 } 362 }
337 } 363 }
338 364
339 void vp9_set_speed_features(VP9_COMP *cpi) { 365 void vp9_set_speed_features(VP9_COMP *cpi) {
340 SPEED_FEATURES *const sf = &cpi->sf; 366 SPEED_FEATURES *const sf = &cpi->sf;
(...skipping 12 matching lines...) Expand all
353 sf->mv.reduce_first_step_size = 0; 379 sf->mv.reduce_first_step_size = 0;
354 sf->mv.auto_mv_step_size = 0; 380 sf->mv.auto_mv_step_size = 0;
355 sf->mv.fullpel_search_step_param = 6; 381 sf->mv.fullpel_search_step_param = 6;
356 sf->comp_inter_joint_search_thresh = BLOCK_4X4; 382 sf->comp_inter_joint_search_thresh = BLOCK_4X4;
357 sf->adaptive_rd_thresh = 0; 383 sf->adaptive_rd_thresh = 0;
358 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_OFF; 384 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_OFF;
359 sf->tx_size_search_method = USE_FULL_RD; 385 sf->tx_size_search_method = USE_FULL_RD;
360 sf->use_lp32x32fdct = 0; 386 sf->use_lp32x32fdct = 0;
361 sf->adaptive_motion_search = 0; 387 sf->adaptive_motion_search = 0;
362 sf->adaptive_pred_interp_filter = 0; 388 sf->adaptive_pred_interp_filter = 0;
389 sf->adaptive_mode_search = 0;
363 sf->cb_pred_filter_search = 0; 390 sf->cb_pred_filter_search = 0;
364 sf->cb_partition_search = 0; 391 sf->cb_partition_search = 0;
365 sf->motion_field_mode_search = 0; 392 sf->motion_field_mode_search = 0;
366 sf->alt_ref_search_fp = 0; 393 sf->alt_ref_search_fp = 0;
367 sf->use_quant_fp = 0; 394 sf->use_quant_fp = 0;
368 sf->reference_masking = 0; 395 sf->reference_masking = 0;
369 sf->partition_search_type = SEARCH_PARTITION; 396 sf->partition_search_type = SEARCH_PARTITION;
370 sf->less_rectangular_check = 0; 397 sf->less_rectangular_check = 0;
371 sf->use_square_partition_only = 0; 398 sf->use_square_partition_only = 0;
372 sf->auto_min_max_partition_size = NOT_IN_USE; 399 sf->auto_min_max_partition_size = NOT_IN_USE;
373 sf->max_partition_size = BLOCK_64X64; 400 sf->max_partition_size = BLOCK_64X64;
374 sf->min_partition_size = BLOCK_4X4; 401 sf->min_partition_size = BLOCK_4X4;
375 sf->adjust_partitioning_from_last_frame = 0; 402 sf->adjust_partitioning_from_last_frame = 0;
376 sf->last_partitioning_redo_frequency = 4; 403 sf->last_partitioning_redo_frequency = 4;
377 sf->constrain_copy_partition = 0; 404 sf->constrain_copy_partition = 0;
378 sf->disable_split_mask = 0; 405 sf->disable_split_mask = 0;
379 sf->mode_search_skip_flags = 0; 406 sf->mode_search_skip_flags = 0;
380 sf->force_frame_boost = 0; 407 sf->force_frame_boost = 0;
381 sf->max_delta_qindex = 0; 408 sf->max_delta_qindex = 0;
382 sf->disable_filter_search_var_thresh = 0; 409 sf->disable_filter_search_var_thresh = 0;
410 sf->adaptive_interp_filter_search = 0;
411
383 for (i = 0; i < TX_SIZES; i++) { 412 for (i = 0; i < TX_SIZES; i++) {
384 sf->intra_y_mode_mask[i] = INTRA_ALL; 413 sf->intra_y_mode_mask[i] = INTRA_ALL;
385 sf->intra_uv_mode_mask[i] = INTRA_ALL; 414 sf->intra_uv_mode_mask[i] = INTRA_ALL;
386 } 415 }
387 sf->use_rd_breakout = 0; 416 sf->use_rd_breakout = 0;
388 sf->skip_encode_sb = 0; 417 sf->skip_encode_sb = 0;
389 sf->use_uv_intra_rd_estimate = 0; 418 sf->use_uv_intra_rd_estimate = 0;
390 sf->allow_skip_recode = 0; 419 sf->allow_skip_recode = 0;
391 sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE; 420 sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE;
392 sf->use_fast_coef_updates = TWO_LOOP; 421 sf->use_fast_coef_updates = TWO_LOOP;
393 sf->use_fast_coef_costing = 0; 422 sf->use_fast_coef_costing = 0;
394 sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set 423 sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set
395 sf->use_nonrd_pick_mode = 0; 424 sf->use_nonrd_pick_mode = 0;
396 for (i = 0; i < BLOCK_SIZES; ++i) 425 for (i = 0; i < BLOCK_SIZES; ++i)
397 sf->inter_mode_mask[i] = INTER_ALL; 426 sf->inter_mode_mask[i] = INTER_ALL;
398 sf->max_intra_bsize = BLOCK_64X64; 427 sf->max_intra_bsize = BLOCK_64X64;
399 sf->reuse_inter_pred_sby = 0; 428 sf->reuse_inter_pred_sby = 0;
400 // This setting only takes effect when partition_search_type is set 429 // This setting only takes effect when partition_search_type is set
401 // to FIXED_PARTITION. 430 // to FIXED_PARTITION.
402 sf->always_this_block_size = BLOCK_16X16; 431 sf->always_this_block_size = BLOCK_16X16;
403 sf->search_type_check_frequency = 50; 432 sf->search_type_check_frequency = 50;
404 sf->encode_breakout_thresh = 0; 433 sf->encode_breakout_thresh = 0;
405 sf->elevate_newmv_thresh = 0; 434 sf->elevate_newmv_thresh = 0;
406 // Recode loop tolerence %. 435 // Recode loop tolerence %.
407 sf->recode_tolerance = 25; 436 sf->recode_tolerance = 25;
408 sf->default_interp_filter = SWITCHABLE; 437 sf->default_interp_filter = SWITCHABLE;
409 sf->tx_size_search_breakout = 0; 438 sf->tx_size_search_breakout = 0;
439 sf->partition_search_breakout_dist_thr = 0;
440 sf->partition_search_breakout_rate_thr = 0;
410 441
411 if (oxcf->mode == REALTIME) { 442 if (oxcf->mode == REALTIME)
412 set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content); 443 set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content);
413 } else { 444 else if (oxcf->mode == GOOD)
414 if (!is_best_mode(oxcf->mode)) 445 set_good_speed_feature(cpi, cm, sf, oxcf->speed);
415 set_good_speed_feature(cpi, cm, sf, oxcf->speed);
416 }
417 446
418 cpi->full_search_sad = vp9_full_search_sad; 447 cpi->full_search_sad = vp9_full_search_sad;
419 cpi->diamond_search_sad = is_best_mode(oxcf->mode) ? vp9_full_range_search 448 cpi->diamond_search_sad = oxcf->mode == BEST ? vp9_full_range_search
420 : vp9_diamond_search_sad; 449 : vp9_diamond_search_sad;
421 cpi->refining_search_sad = vp9_refining_search_sad; 450 cpi->refining_search_sad = vp9_refining_search_sad;
422 451
423 452
424 // Slow quant, dct and trellis not worthwhile for first pass 453 // Slow quant, dct and trellis not worthwhile for first pass
425 // so make sure they are always turned off. 454 // so make sure they are always turned off.
426 if (oxcf->pass == 1) 455 if (oxcf->pass == 1)
427 sf->optimize_coefficients = 0; 456 sf->optimize_coefficients = 0;
428 457
429 // No recode for 1 pass. 458 // No recode for 1 pass.
430 if (oxcf->pass == 0) { 459 if (oxcf->pass == 0) {
431 sf->recode_loop = DISALLOW_RECODE; 460 sf->recode_loop = DISALLOW_RECODE;
432 sf->optimize_coefficients = 0; 461 sf->optimize_coefficients = 0;
433 } 462 }
434 463
435 if (sf->mv.subpel_search_method == SUBPEL_TREE) { 464 if (sf->mv.subpel_search_method == SUBPEL_TREE) {
436 cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree; 465 cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree;
466 } else if (sf->mv.subpel_search_method == SUBPEL_TREE_PRUNED) {
467 cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree_pruned;
437 } 468 }
438 469
439 cpi->mb.optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1; 470 cpi->mb.optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1;
440 471
441 if (sf->disable_split_mask == DISABLE_ALL_SPLIT) 472 if (sf->disable_split_mask == DISABLE_ALL_SPLIT)
442 sf->adaptive_pred_interp_filter = 0; 473 sf->adaptive_pred_interp_filter = 0;
443 474
444 if (!cpi->oxcf.frame_periodic_boost) { 475 if (!cpi->oxcf.frame_periodic_boost) {
445 sf->max_delta_qindex = 0; 476 sf->max_delta_qindex = 0;
446 } 477 }
447 478
448 if (cpi->encode_breakout && oxcf->mode == REALTIME && 479 if (cpi->encode_breakout && oxcf->mode == REALTIME &&
449 sf->encode_breakout_thresh > cpi->encode_breakout) 480 sf->encode_breakout_thresh > cpi->encode_breakout)
450 cpi->encode_breakout = sf->encode_breakout_thresh; 481 cpi->encode_breakout = sf->encode_breakout_thresh;
451 } 482 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_speed_features.h ('k') | source/libvpx/vp9/encoder/vp9_ssim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698