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

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

Issue 484923003: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 4 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
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 DISABLE_ALL_SPLIT = (1 << THR_INTRA) | DISABLE_ALL_INTER_SPLIT, 43 DISABLE_ALL_SPLIT = (1 << THR_INTRA) | DISABLE_ALL_INTER_SPLIT,
44 44
45 DISABLE_COMPOUND_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA), 45 DISABLE_COMPOUND_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA),
46 46
47 LAST_AND_INTRA_SPLIT_ONLY = (1 << THR_COMP_GA) | 47 LAST_AND_INTRA_SPLIT_ONLY = (1 << THR_COMP_GA) |
48 (1 << THR_COMP_LA) | 48 (1 << THR_COMP_LA) |
49 (1 << THR_ALTR) | 49 (1 << THR_ALTR) |
50 (1 << THR_GOLD) 50 (1 << THR_GOLD)
51 }; 51 };
52 52
53 // Intra only frames, golden frames (except alt ref overlays) and
54 // alt ref frames tend to be coded at a higher than ambient quality
55 static int frame_is_boosted(const VP9_COMP *cpi) {
56 return frame_is_intra_only(&cpi->common) ||
57 cpi->refresh_alt_ref_frame ||
58 (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref) ||
59 vp9_is_upper_layer_key_frame(cpi);
60 }
61
62
53 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,
54 SPEED_FEATURES *sf, int speed) { 64 SPEED_FEATURES *sf, int speed) {
65 const int boosted = frame_is_boosted(cpi);
66
55 sf->adaptive_rd_thresh = 1; 67 sf->adaptive_rd_thresh = 1;
56 sf->recode_loop = (speed < 1) ? ALLOW_RECODE : ALLOW_RECODE_KFMAXBW; 68 sf->recode_loop = (speed < 1) ? ALLOW_RECODE : ALLOW_RECODE_KFMAXBW;
57 sf->allow_skip_recode = 1; 69 sf->allow_skip_recode = 1;
58 70
59 if (speed >= 1) { 71 if (speed >= 1) {
60 sf->use_square_partition_only = !frame_is_intra_only(cm); 72 sf->use_square_partition_only = !frame_is_intra_only(cm);
61 sf->less_rectangular_check = 1; 73 sf->less_rectangular_check = 1;
62 sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD
63 : USE_LARGESTALL;
64 74
65 if (MIN(cm->width, cm->height) >= 720) 75 if (MIN(cm->width, cm->height) >= 720)
66 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT 76 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
67 : DISABLE_ALL_INTER_SPLIT; 77 : DISABLE_ALL_INTER_SPLIT;
68 else 78 else
69 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; 79 sf->disable_split_mask = DISABLE_COMPOUND_SPLIT;
70 sf->use_rd_breakout = 1; 80 sf->use_rd_breakout = 1;
71 sf->adaptive_motion_search = 1; 81 sf->adaptive_motion_search = 1;
72 sf->mv.auto_mv_step_size = 1; 82 sf->mv.auto_mv_step_size = 1;
73 sf->adaptive_rd_thresh = 2; 83 sf->adaptive_rd_thresh = 2;
74 sf->mv.subpel_iters_per_step = 1; 84 sf->mv.subpel_iters_per_step = 1;
75 sf->mode_skip_start = 10; 85 sf->mode_skip_start = 10;
76 sf->adaptive_pred_interp_filter = 1; 86 sf->adaptive_pred_interp_filter = 1;
77 87
78 sf->recode_loop = ALLOW_RECODE_KFARFGF; 88 sf->recode_loop = ALLOW_RECODE_KFARFGF;
79 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; 89 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
80 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V; 90 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
81 sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V; 91 sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
82 sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V; 92 sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
93
94 sf->tx_size_search_breakout = 1;
83 } 95 }
84 96
85 if (speed >= 2) { 97 if (speed >= 2) {
98 sf->tx_size_search_method = frame_is_boosted(cpi) ? USE_FULL_RD
99 : USE_LARGESTALL;
100
86 if (MIN(cm->width, cm->height) >= 720) { 101 if (MIN(cm->width, cm->height) >= 720) {
87 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; 102 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
88 sf->last_partitioning_redo_frequency = 3; 103 sf->last_partitioning_redo_frequency = 3;
89 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT 104 sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
90 : DISABLE_ALL_INTER_SPLIT; 105 : DISABLE_ALL_INTER_SPLIT;
91 sf->adaptive_pred_interp_filter = 0; 106 sf->adaptive_pred_interp_filter = 0;
92 } else { 107 } else {
93 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY; 108 sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
94 sf->last_partitioning_redo_frequency = 2; 109 sf->last_partitioning_redo_frequency = 2;
95 sf->lf_motion_threshold = NO_MOTION_THRESHOLD; 110 sf->lf_motion_threshold = NO_MOTION_THRESHOLD;
96 } 111 }
97 112
98 sf->reference_masking = 1; 113 sf->reference_masking = 1;
99 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH | 114 sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
100 FLAG_SKIP_INTRA_BESTINTER | 115 FLAG_SKIP_INTRA_BESTINTER |
101 FLAG_SKIP_COMP_BESTINTRA | 116 FLAG_SKIP_COMP_BESTINTRA |
102 FLAG_SKIP_INTRA_LOWVAR; 117 FLAG_SKIP_INTRA_LOWVAR;
103 sf->disable_filter_search_var_thresh = 100; 118 sf->disable_filter_search_var_thresh = 100;
104 sf->comp_inter_joint_search_thresh = BLOCK_SIZES; 119 sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
105 sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX; 120 sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX;
106 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION; 121 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION;
107 sf->adjust_partitioning_from_last_frame = 1; 122 sf->adjust_partitioning_from_last_frame = 1;
108 } 123 }
109 124
110 if (speed >= 3) { 125 if (speed >= 3) {
111 sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD 126 sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD
112 : USE_LARGESTALL; 127 : USE_LARGESTALL;
113 if (MIN(cm->width, cm->height) >= 720) { 128 if (MIN(cm->width, cm->height) >= 720) {
114 sf->disable_split_mask = DISABLE_ALL_SPLIT; 129 sf->disable_split_mask = DISABLE_ALL_SPLIT;
115 } else { 130 } else {
116 sf->max_intra_bsize = BLOCK_32X32; 131 sf->max_intra_bsize = BLOCK_32X32;
117 sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT; 132 sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
118 } 133 }
119 sf->adaptive_pred_interp_filter = 0; 134 sf->adaptive_pred_interp_filter = 0;
120 sf->cb_partition_search = frame_is_boosted(cpi) ? 0 : 1; 135 sf->cb_partition_search = !boosted;
121 sf->cb_pred_filter_search = 1; 136 sf->cb_pred_filter_search = 1;
122 sf->motion_field_mode_search = frame_is_boosted(cpi) ? 0 : 1; 137 sf->alt_ref_search_fp = 1;
138 sf->motion_field_mode_search = !boosted;
123 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; 139 sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
124 sf->last_partitioning_redo_frequency = 3; 140 sf->last_partitioning_redo_frequency = 3;
125 sf->recode_loop = ALLOW_RECODE_KFMAXBW; 141 sf->recode_loop = ALLOW_RECODE_KFMAXBW;
126 sf->adaptive_rd_thresh = 3; 142 sf->adaptive_rd_thresh = 3;
127 sf->mode_skip_start = 6; 143 sf->mode_skip_start = 6;
128 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC; 144 sf->intra_y_mode_mask[TX_32X32] = INTRA_DC;
129 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC; 145 sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC;
130 } 146 }
131 147
132 if (speed >= 4) { 148 if (speed >= 4) {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 sf->comp_inter_joint_search_thresh = BLOCK_4X4; 356 sf->comp_inter_joint_search_thresh = BLOCK_4X4;
341 sf->adaptive_rd_thresh = 0; 357 sf->adaptive_rd_thresh = 0;
342 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_OFF; 358 sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_OFF;
343 sf->tx_size_search_method = USE_FULL_RD; 359 sf->tx_size_search_method = USE_FULL_RD;
344 sf->use_lp32x32fdct = 0; 360 sf->use_lp32x32fdct = 0;
345 sf->adaptive_motion_search = 0; 361 sf->adaptive_motion_search = 0;
346 sf->adaptive_pred_interp_filter = 0; 362 sf->adaptive_pred_interp_filter = 0;
347 sf->cb_pred_filter_search = 0; 363 sf->cb_pred_filter_search = 0;
348 sf->cb_partition_search = 0; 364 sf->cb_partition_search = 0;
349 sf->motion_field_mode_search = 0; 365 sf->motion_field_mode_search = 0;
366 sf->alt_ref_search_fp = 0;
350 sf->use_quant_fp = 0; 367 sf->use_quant_fp = 0;
351 sf->reference_masking = 0; 368 sf->reference_masking = 0;
352 sf->partition_search_type = SEARCH_PARTITION; 369 sf->partition_search_type = SEARCH_PARTITION;
353 sf->less_rectangular_check = 0; 370 sf->less_rectangular_check = 0;
354 sf->use_square_partition_only = 0; 371 sf->use_square_partition_only = 0;
355 sf->auto_min_max_partition_size = NOT_IN_USE; 372 sf->auto_min_max_partition_size = NOT_IN_USE;
356 sf->max_partition_size = BLOCK_64X64; 373 sf->max_partition_size = BLOCK_64X64;
357 sf->min_partition_size = BLOCK_4X4; 374 sf->min_partition_size = BLOCK_4X4;
358 sf->adjust_partitioning_from_last_frame = 0; 375 sf->adjust_partitioning_from_last_frame = 0;
359 sf->last_partitioning_redo_frequency = 4; 376 sf->last_partitioning_redo_frequency = 4;
(...skipping 22 matching lines...) Expand all
382 sf->reuse_inter_pred_sby = 0; 399 sf->reuse_inter_pred_sby = 0;
383 // This setting only takes effect when partition_search_type is set 400 // This setting only takes effect when partition_search_type is set
384 // to FIXED_PARTITION. 401 // to FIXED_PARTITION.
385 sf->always_this_block_size = BLOCK_16X16; 402 sf->always_this_block_size = BLOCK_16X16;
386 sf->search_type_check_frequency = 50; 403 sf->search_type_check_frequency = 50;
387 sf->encode_breakout_thresh = 0; 404 sf->encode_breakout_thresh = 0;
388 sf->elevate_newmv_thresh = 0; 405 sf->elevate_newmv_thresh = 0;
389 // Recode loop tolerence %. 406 // Recode loop tolerence %.
390 sf->recode_tolerance = 25; 407 sf->recode_tolerance = 25;
391 sf->default_interp_filter = SWITCHABLE; 408 sf->default_interp_filter = SWITCHABLE;
409 sf->tx_size_search_breakout = 0;
392 410
393 if (oxcf->mode == REALTIME) { 411 if (oxcf->mode == REALTIME) {
394 set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content); 412 set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content);
395 } else { 413 } else {
396 if (!is_best_mode(oxcf->mode)) 414 if (!is_best_mode(oxcf->mode))
397 set_good_speed_feature(cpi, cm, sf, oxcf->speed); 415 set_good_speed_feature(cpi, cm, sf, oxcf->speed);
398 } 416 }
399 417
400 cpi->full_search_sad = vp9_full_search_sad; 418 cpi->full_search_sad = vp9_full_search_sad;
401 cpi->diamond_search_sad = is_best_mode(oxcf->mode) ? vp9_full_range_search 419 cpi->diamond_search_sad = is_best_mode(oxcf->mode) ? vp9_full_range_search
(...skipping 22 matching lines...) Expand all
424 sf->adaptive_pred_interp_filter = 0; 442 sf->adaptive_pred_interp_filter = 0;
425 443
426 if (!cpi->oxcf.frame_periodic_boost) { 444 if (!cpi->oxcf.frame_periodic_boost) {
427 sf->max_delta_qindex = 0; 445 sf->max_delta_qindex = 0;
428 } 446 }
429 447
430 if (cpi->encode_breakout && oxcf->mode == REALTIME && 448 if (cpi->encode_breakout && oxcf->mode == REALTIME &&
431 sf->encode_breakout_thresh > cpi->encode_breakout) 449 sf->encode_breakout_thresh > cpi->encode_breakout)
432 cpi->encode_breakout = sf->encode_breakout_thresh; 450 cpi->encode_breakout = sf->encode_breakout_thresh;
433 } 451 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_speed_features.h ('k') | source/libvpx/vp9/encoder/vp9_svc_layercontext.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698