ref: 1f94b976947e573258fdcf6648bdef3498cbd662
parent: 727fa7b1e4ee041a7811645e4dd9e7830d9500ad
author: Jim Bankoski <[email protected]>
date: Wed Jun 19 11:53:47 EDT 2013
convert all speed things to speed features Change-Id: Ie24489a4d39f3e53e816eeebf75a1c9c7d94515a
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -594,7 +594,7 @@
sf->thresh_mult[THR_COMP_SPLITLA ] += speed_multiplier * 4500;
sf->thresh_mult[THR_COMP_SPLITGA ] += speed_multiplier * 4500;
- if (speed > 4) {
+ if (cpi->sf.skip_lots_of_modes) {
for (i = 0; i < MAX_MODES; ++i)
sf->thresh_mult[i] = INT_MAX;
@@ -688,6 +688,11 @@
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_AB4X4;
sf->adpative_rd_thresh = 0;
sf->use_lastframe_partitioning = 0;
+ sf->use_largest_txform = 0;
+ sf->use_8tap_always = 0;
+ sf->use_avoid_tested_higherror = 0;
+ sf->skip_lots_of_modes = 0;
+ sf->adjust_thresholds_by_speed = 0;
#if CONFIG_MULTIPLE_ARF
// Switch segmentation off.
@@ -715,8 +720,11 @@
sf->optimize_coefficients = 0;
sf->first_step = 1;
}
- if (speed == 2)
+ if (speed == 2) {
+ sf->comp_inter_joint_search_thresh = BLOCK_SIZE_SB8X8;
sf->use_lastframe_partitioning = 1;
+ sf->first_step = 0;
+ }
break;
@@ -723,7 +731,10 @@
}; /* switch */
// Set rd thresholds based on mode and speed setting
- set_rd_speed_thresholds(cpi, mode, speed);
+ if(cpi->sf.adjust_thresholds_by_speed)
+ set_rd_speed_thresholds(cpi, mode, speed);
+ else
+ set_rd_speed_thresholds(cpi, mode, 0);
// Slow quant, dct and trellis not worthwhile for first pass
// so make sure they are always turned off.
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -217,6 +217,11 @@
int comp_inter_joint_search_thresh;
int adpative_rd_thresh;
int use_lastframe_partitioning;
+ int use_largest_txform;
+ int use_8tap_always;
+ int use_avoid_tested_higherror;
+ int skip_lots_of_modes;
+ int adjust_thresholds_by_speed;
} SPEED_FEATURES;
enum BlockSize {
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -614,7 +614,7 @@
if (mbmi->ref_frame[0] > INTRA_FRAME)
vp9_subtract_sby(x, bs);
- if (cpi->speed > 4) {
+ if (cpi->sf.use_largest_txform) {
if (bs >= BLOCK_SIZE_SB32X32) {
mbmi->txfm_size = TX_32X32;
} else if (bs >= BLOCK_SIZE_MB16X16) {
@@ -2236,7 +2236,7 @@
(mbmi->mv[1].as_mv.col & 15) == 0;
// Search for best switchable filter by checking the variance of
// pred error irrespective of whether the filter will be used
- if (cpi->speed > 4) {
+ if (cpi->sf.use_8tap_always) {
*best_filter = EIGHTTAP;
} else {
int i, newbest;
@@ -2536,7 +2536,7 @@
best_txfm_rd[i] = INT64_MAX;
// Create a mask set to 1 for each frame used by a smaller resolution.
- if (cpi->speed > 0) {
+ if (cpi->sf.use_avoid_tested_higherror) {
switch (block_size) {
case BLOCK_64X64:
for (i = 0; i < 4; i++) {
@@ -2576,8 +2576,9 @@
frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
frame_mv[ZEROMV][ref_frame].as_int = 0;
}
- if (cpi->speed == 0
- || (cpi->speed > 0 && (ref_frame_mask & (1 << INTRA_FRAME)))) {
+ if (!cpi->sf.use_avoid_tested_higherror
+ || (cpi->sf.use_avoid_tested_higherror
+ && (ref_frame_mask & (1 << INTRA_FRAME)))) {
mbmi->mode = DC_PRED;
mbmi->ref_frame[0] = INTRA_FRAME;
for (i = 0; i <= (bsize < BLOCK_SIZE_MB16X16 ? TX_4X4 :
@@ -2623,7 +2624,7 @@
this_mode = vp9_mode_order[mode_index].mode;
ref_frame = vp9_mode_order[mode_index].ref_frame;
- if (cpi->speed > 0 && bsize >= BLOCK_SIZE_SB8X8) {
+ if (cpi->sf.use_avoid_tested_higherror && bsize >= BLOCK_SIZE_SB8X8) {
if (!(ref_frame_mask & (1 << ref_frame))) {
continue;
}