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

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

Issue 812033011: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 5 years, 11 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_rdopt.c ('k') | source/libvpx/vp9/encoder/vp9_svc_layercontext.c » ('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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 sf->tx_size_search_breakout = 1; 100 sf->tx_size_search_breakout = 1;
101 sf->partition_search_breakout_rate_thr = 80; 101 sf->partition_search_breakout_rate_thr = 80;
102 } 102 }
103 103
104 if (speed >= 2) { 104 if (speed >= 2) {
105 sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD 105 sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD
106 : USE_LARGESTALL; 106 : USE_LARGESTALL;
107 107
108 sf->reference_masking = 1; 108 sf->reference_masking = 1;
109 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH | 109 sf->mode_search_skip_flags = (cm->frame_type == KEY_FRAME) ? 0 :
110 FLAG_SKIP_INTRA_DIRMISMATCH |
110 FLAG_SKIP_INTRA_BESTINTER | 111 FLAG_SKIP_INTRA_BESTINTER |
111 FLAG_SKIP_COMP_BESTINTRA | 112 FLAG_SKIP_COMP_BESTINTRA |
112 FLAG_SKIP_INTRA_LOWVAR; 113 FLAG_SKIP_INTRA_LOWVAR;
113 sf->disable_filter_search_var_thresh = 100; 114 sf->disable_filter_search_var_thresh = 100;
114 sf->comp_inter_joint_search_thresh = BLOCK_SIZES; 115 sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
115 sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX; 116 sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX;
116 117
117 sf->allow_partition_search_skip = 1; 118 sf->allow_partition_search_skip = 1;
118 } 119 }
119 120
(...skipping 13 matching lines...) Expand all
133 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC; 134 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC;
134 sf->adaptive_interp_filter_search = 1; 135 sf->adaptive_interp_filter_search = 1;
135 } 136 }
136 137
137 if (speed >= 4) { 138 if (speed >= 4) {
138 sf->use_square_partition_only = 1; 139 sf->use_square_partition_only = 1;
139 sf->tx_size_search_method = USE_LARGESTALL; 140 sf->tx_size_search_method = USE_LARGESTALL;
140 sf->mv.search_method = BIGDIA; 141 sf->mv.search_method = BIGDIA;
141 sf->mv.subpel_search_method = SUBPEL_TREE_PRUNED_MORE; 142 sf->mv.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
142 sf->adaptive_rd_thresh = 4; 143 sf->adaptive_rd_thresh = 4;
143 sf->mode_search_skip_flags |= FLAG_EARLY_TERMINATE; 144 if (cm->frame_type != KEY_FRAME)
145 sf->mode_search_skip_flags |= FLAG_EARLY_TERMINATE;
144 sf->disable_filter_search_var_thresh = 200; 146 sf->disable_filter_search_var_thresh = 200;
145 sf->use_lp32x32fdct = 1; 147 sf->use_lp32x32fdct = 1;
146 sf->use_fast_coef_updates = ONE_LOOP_REDUCED; 148 sf->use_fast_coef_updates = ONE_LOOP_REDUCED;
147 sf->use_fast_coef_costing = 1; 149 sf->use_fast_coef_costing = 1;
148 sf->motion_field_mode_search = !boosted; 150 sf->motion_field_mode_search = !boosted;
149 sf->partition_search_breakout_rate_thr = 300; 151 sf->partition_search_breakout_rate_thr = 300;
150 } 152 }
151 153
152 if (speed >= 5) { 154 if (speed >= 5) {
153 int i; 155 int i;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 sf->adaptive_motion_search = 1; 221 sf->adaptive_motion_search = 1;
220 sf->adaptive_pred_interp_filter = 1; 222 sf->adaptive_pred_interp_filter = 1;
221 sf->mv.auto_mv_step_size = 1; 223 sf->mv.auto_mv_step_size = 1;
222 sf->adaptive_rd_thresh = 2; 224 sf->adaptive_rd_thresh = 2;
223 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; 225 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
224 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V; 226 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
225 sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V; 227 sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
226 } 228 }
227 229
228 if (speed >= 2) { 230 if (speed >= 2) {
229 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH | 231 sf->mode_search_skip_flags = (cm->frame_type == KEY_FRAME) ? 0 :
232 FLAG_SKIP_INTRA_DIRMISMATCH |
230 FLAG_SKIP_INTRA_BESTINTER | 233 FLAG_SKIP_INTRA_BESTINTER |
231 FLAG_SKIP_COMP_BESTINTRA | 234 FLAG_SKIP_COMP_BESTINTRA |
232 FLAG_SKIP_INTRA_LOWVAR; 235 FLAG_SKIP_INTRA_LOWVAR;
233 sf->adaptive_pred_interp_filter = 2; 236 sf->adaptive_pred_interp_filter = 2;
234 sf->reference_masking = 1; 237 sf->reference_masking = 1;
235 sf->disable_filter_search_var_thresh = 50; 238 sf->disable_filter_search_var_thresh = 50;
236 sf->comp_inter_joint_search_thresh = BLOCK_SIZES; 239 sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
237 sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX; 240 sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
238 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; 241 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
239 sf->adjust_partitioning_from_last_frame = 1; 242 sf->adjust_partitioning_from_last_frame = 1;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO; 301 sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO;
299 sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO; 302 sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO;
300 sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO; 303 sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO;
301 sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST_NEW_ZERO; 304 sf->inter_mode_mask[BLOCK_64X64] = INTER_NEAREST_NEW_ZERO;
302 sf->adaptive_rd_thresh = 2; 305 sf->adaptive_rd_thresh = 2;
303 // This feature is only enabled when partition search is disabled. 306 // This feature is only enabled when partition search is disabled.
304 sf->reuse_inter_pred_sby = 1; 307 sf->reuse_inter_pred_sby = 1;
305 sf->partition_search_breakout_rate_thr = 200; 308 sf->partition_search_breakout_rate_thr = 200;
306 sf->coeff_prob_appx_step = 4; 309 sf->coeff_prob_appx_step = 4;
307 sf->use_fast_coef_updates = is_keyframe ? TWO_LOOP : ONE_LOOP_REDUCED; 310 sf->use_fast_coef_updates = is_keyframe ? TWO_LOOP : ONE_LOOP_REDUCED;
311 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH;
308 312
309 if (!is_keyframe) { 313 if (!is_keyframe) {
310 int i; 314 int i;
311 if (content == VP9E_CONTENT_SCREEN) { 315 if (content == VP9E_CONTENT_SCREEN) {
312 for (i = 0; i < TX_SIZES; ++i) 316 for (i = 0; i < TX_SIZES; ++i)
313 sf->intra_y_mode_mask[i] = INTRA_DC_TM_H_V; 317 sf->intra_y_mode_mask[i] = INTRA_DC_TM_H_V;
314 } else { 318 } else {
315 for (i = 0; i < TX_SIZES; i++) 319 for (i = 0; i < TX_SIZES; i++)
316 sf->intra_y_mode_mask[i] = INTRA_DC; 320 sf->intra_y_mode_mask[i] = INTRA_DC;
317 } 321 }
318 } 322 }
319 } 323 }
320 324
321 if (speed >= 6) { 325 if (speed >= 6) {
322 // Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION. 326 // Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION.
323 sf->partition_search_type = VAR_BASED_PARTITION; 327 sf->partition_search_type = VAR_BASED_PARTITION;
324
325 // Turn on this to use non-RD key frame coding mode. 328 // Turn on this to use non-RD key frame coding mode.
326 sf->use_nonrd_pick_mode = 1; 329 sf->use_nonrd_pick_mode = 1;
327 sf->mv.search_method = NSTEP; 330 sf->mv.search_method = NSTEP;
328 sf->tx_size_search_method = is_keyframe ? USE_LARGESTALL : USE_TX_8X8; 331 sf->tx_size_search_method = is_keyframe ? USE_LARGESTALL : USE_TX_8X8;
329 sf->mv.reduce_first_step_size = 1; 332 sf->mv.reduce_first_step_size = 1;
330 sf->skip_encode_sb = 0; 333 sf->skip_encode_sb = 0;
331 } 334 }
332 335
333 if (speed >= 7) { 336 if (speed >= 7) {
334 sf->adaptive_rd_thresh = 3; 337 sf->adaptive_rd_thresh = 3;
335 sf->mv.search_method = FAST_DIAMOND; 338 sf->mv.search_method = FAST_DIAMOND;
336 sf->mv.fullpel_search_step_param = 10; 339 sf->mv.fullpel_search_step_param = 10;
337 sf->lpf_pick = LPF_PICK_MINIMAL_LPF; 340 sf->lpf_pick = LPF_PICK_MINIMAL_LPF;
338 } 341 }
339 342 if (speed >= 8) {
340 if (speed >= 12) {
341 sf->adaptive_rd_thresh = 4; 343 sf->adaptive_rd_thresh = 4;
342 sf->mv.subpel_force_stop = 2; 344 sf->mv.subpel_force_stop = 2;
343 } 345 }
344
345 if (speed >= 13) {
346 int i;
347 sf->max_intra_bsize = BLOCK_32X32;
348 for (i = 0; i < BLOCK_SIZES; ++i)
349 sf->inter_mode_mask[i] = INTER_NEAREST;
350 }
351 } 346 }
352 347
353 void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) { 348 void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) {
354 SPEED_FEATURES *const sf = &cpi->sf; 349 SPEED_FEATURES *const sf = &cpi->sf;
355 VP9_COMMON *const cm = &cpi->common; 350 VP9_COMMON *const cm = &cpi->common;
356 const VP9EncoderConfig *const oxcf = &cpi->oxcf; 351 const VP9EncoderConfig *const oxcf = &cpi->oxcf;
357 RD_OPT *const rd = &cpi->rd; 352 RD_OPT *const rd = &cpi->rd;
358 int i; 353 int i;
359 354
360 if (oxcf->mode == REALTIME) { 355 if (oxcf->mode == REALTIME) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 486
492 x->optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1; 487 x->optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1;
493 488
494 x->min_partition_size = sf->default_min_partition_size; 489 x->min_partition_size = sf->default_min_partition_size;
495 x->max_partition_size = sf->default_max_partition_size; 490 x->max_partition_size = sf->default_max_partition_size;
496 491
497 if (!cpi->oxcf.frame_periodic_boost) { 492 if (!cpi->oxcf.frame_periodic_boost) {
498 sf->max_delta_qindex = 0; 493 sf->max_delta_qindex = 0;
499 } 494 }
500 } 495 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_rdopt.c ('k') | source/libvpx/vp9/encoder/vp9_svc_layercontext.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698