From 69fe840ec4588ef131b0927484a34efd8709f519 Mon Sep 17 00:00:00 2001 From: Deb Mukherjee Date: Tue, 10 Sep 2013 16:13:15 -0700 Subject: [PATCH] Changes in speed 2 settings Propose some changes to the speed 2 settings to improve quality. In particular, turns off the adjust_thresholds_by_speed feature which improves results by 6%. Also removes the code for adjust_thresholds_by_speed since it conflicts with the adaptive rd thresh feature. Overall, with this change speed 2 is -15.2% from speed 0 settings, on derf, which is significantly better than -21.6% down before. Change-Id: I6e90a563470979eb0c258ec32d6183ed7ce9a505 --- vp9/encoder/vp9_onyx_if.c | 90 ++++++++++++++++++++++------------------------ vp9/encoder/vp9_onyx_int.h | 1 - 2 files changed, 42 insertions(+), 49 deletions(-) diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index f470253..a547958 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -557,9 +557,8 @@ static void set_default_lf_deltas(struct loopfilter *lf) { lf->mode_deltas[1] = 0; // New mv } -static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) { +static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) { SPEED_FEATURES *sf = &cpi->sf; - int speed_multiplier = speed + 1; int i; // Set baseline threshold values @@ -570,46 +569,46 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) { sf->thresh_mult[THR_NEARESTG] = 0; sf->thresh_mult[THR_NEARESTA] = 0; - sf->thresh_mult[THR_NEWMV] += speed_multiplier * 1000; - sf->thresh_mult[THR_COMP_NEARESTLA] += speed_multiplier * 1000; - sf->thresh_mult[THR_NEARMV] += speed_multiplier * 1000; - sf->thresh_mult[THR_COMP_NEARESTGA] += speed_multiplier * 1000; - - sf->thresh_mult[THR_DC] += speed_multiplier * 1000; - - sf->thresh_mult[THR_NEWG] += speed_multiplier * 1000; - sf->thresh_mult[THR_NEWA] += speed_multiplier * 1000; - sf->thresh_mult[THR_NEARA] += speed_multiplier * 1000; - - sf->thresh_mult[THR_TM] += speed_multiplier * 1000; - - sf->thresh_mult[THR_COMP_NEARLA] += speed_multiplier * 1500; - sf->thresh_mult[THR_COMP_NEWLA] += speed_multiplier * 2000; - sf->thresh_mult[THR_NEARG] += speed_multiplier * 1000; - sf->thresh_mult[THR_COMP_NEARGA] += speed_multiplier * 1500; - sf->thresh_mult[THR_COMP_NEWGA] += speed_multiplier * 2000; - - sf->thresh_mult[THR_SPLITMV] += speed_multiplier * 2500; - sf->thresh_mult[THR_SPLITG] += speed_multiplier * 2500; - sf->thresh_mult[THR_SPLITA] += speed_multiplier * 2500; - sf->thresh_mult[THR_COMP_SPLITLA] += speed_multiplier * 4500; - sf->thresh_mult[THR_COMP_SPLITGA] += speed_multiplier * 4500; - - sf->thresh_mult[THR_ZEROMV] += speed_multiplier * 2000; - sf->thresh_mult[THR_ZEROG] += speed_multiplier * 2000; - sf->thresh_mult[THR_ZEROA] += speed_multiplier * 2000; - sf->thresh_mult[THR_COMP_ZEROLA] += speed_multiplier * 2500; - sf->thresh_mult[THR_COMP_ZEROGA] += speed_multiplier * 2500; - - sf->thresh_mult[THR_B_PRED] += speed_multiplier * 2500; - sf->thresh_mult[THR_H_PRED] += speed_multiplier * 2000; - sf->thresh_mult[THR_V_PRED] += speed_multiplier * 2000; - sf->thresh_mult[THR_D45_PRED ] += speed_multiplier * 2500; - sf->thresh_mult[THR_D135_PRED] += speed_multiplier * 2500; - sf->thresh_mult[THR_D117_PRED] += speed_multiplier * 2500; - sf->thresh_mult[THR_D153_PRED] += speed_multiplier * 2500; - sf->thresh_mult[THR_D207_PRED] += speed_multiplier * 2500; - sf->thresh_mult[THR_D63_PRED] += speed_multiplier * 2500; + sf->thresh_mult[THR_NEWMV] += 1000; + sf->thresh_mult[THR_COMP_NEARESTLA] += 1000; + sf->thresh_mult[THR_NEARMV] += 1000; + sf->thresh_mult[THR_COMP_NEARESTGA] += 1000; + + sf->thresh_mult[THR_DC] += 1000; + + sf->thresh_mult[THR_NEWG] += 1000; + sf->thresh_mult[THR_NEWA] += 1000; + sf->thresh_mult[THR_NEARA] += 1000; + + sf->thresh_mult[THR_TM] += 1000; + + sf->thresh_mult[THR_COMP_NEARLA] += 1500; + sf->thresh_mult[THR_COMP_NEWLA] += 2000; + sf->thresh_mult[THR_NEARG] += 1000; + sf->thresh_mult[THR_COMP_NEARGA] += 1500; + sf->thresh_mult[THR_COMP_NEWGA] += 2000; + + sf->thresh_mult[THR_SPLITMV] += 2500; + sf->thresh_mult[THR_SPLITG] += 2500; + sf->thresh_mult[THR_SPLITA] += 2500; + sf->thresh_mult[THR_COMP_SPLITLA] += 4500; + sf->thresh_mult[THR_COMP_SPLITGA] += 4500; + + sf->thresh_mult[THR_ZEROMV] += 2000; + sf->thresh_mult[THR_ZEROG] += 2000; + sf->thresh_mult[THR_ZEROA] += 2000; + sf->thresh_mult[THR_COMP_ZEROLA] += 2500; + sf->thresh_mult[THR_COMP_ZEROGA] += 2500; + + sf->thresh_mult[THR_B_PRED] += 2500; + sf->thresh_mult[THR_H_PRED] += 2000; + sf->thresh_mult[THR_V_PRED] += 2000; + sf->thresh_mult[THR_D45_PRED ] += 2500; + sf->thresh_mult[THR_D135_PRED] += 2500; + sf->thresh_mult[THR_D117_PRED] += 2500; + sf->thresh_mult[THR_D153_PRED] += 2500; + sf->thresh_mult[THR_D207_PRED] += 2500; + sf->thresh_mult[THR_D63_PRED] += 2500; if (cpi->sf.skip_lots_of_modes) { for (i = 0; i < MAX_MODES; ++i) @@ -719,7 +718,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->use_avoid_tested_higherror = 0; sf->reference_masking = 0; sf->skip_lots_of_modes = 0; - sf->adjust_thresholds_by_speed = 0; sf->partition_by_variance = 0; sf->use_one_partition_size_always = 0; sf->less_rectangular_check = 0; @@ -805,7 +803,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->mode_skip_start = 9; } if (speed == 2) { - sf->adjust_thresholds_by_speed = 1; sf->less_rectangular_check = 1; sf->use_square_partition_only = 1; sf->comp_inter_joint_search_thresh = BLOCK_SIZES; @@ -908,10 +905,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) { }; /* switch */ // Set rd thresholds based on mode and speed setting - if (cpi->sf.adjust_thresholds_by_speed) - set_rd_speed_thresholds(cpi, mode, speed); - else - set_rd_speed_thresholds(cpi, mode, 0); + set_rd_speed_thresholds(cpi, mode); // Slow quant, dct and trellis not worthwhile for first pass // so make sure they are always turned off. diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h index d83c3f7..18e540a 100644 --- a/vp9/encoder/vp9_onyx_int.h +++ b/vp9/encoder/vp9_onyx_int.h @@ -269,7 +269,6 @@ typedef struct { int use_lp32x32fdct; int use_avoid_tested_higherror; int skip_lots_of_modes; - int adjust_thresholds_by_speed; int partition_by_variance; int use_one_partition_size_always; int less_rectangular_check; -- 2.7.4