From 0fad6a9d99dbd88c87c5e621a18b9c18d9173dce Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Wed, 19 Jun 2013 12:16:45 -0700 Subject: [PATCH] fix to set up new speed feature This uses the speed feature functionality for code. Change-Id: I9cd16c0c5f98520ae27ebba81aa2c178546587f8 --- vp9/encoder/vp9_encodeframe.c | 3 ++- vp9/encoder/vp9_onyx_if.c | 34 ++++++++++++++++++++++------------ vp9/encoder/vp9_onyx_int.h | 1 + 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 604ab54..714198e 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1397,10 +1397,11 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, for (mi_col = cm->cur_tile_mi_col_start; mi_col < cm->cur_tile_mi_col_end; mi_col += 64 / MI_SIZE) { int dummy_rate, dummy_dist; - if (cpi->speed < 5) { + if (!cpi->sf.use_lastframe_partitioning) { rd_pick_partition(cpi, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64, &dummy_rate, &dummy_dist); } else { + const int idx_str = cm->mode_info_stride * mi_row + mi_col; MODE_INFO *m = cm->mi + idx_str; MODE_INFO *p = cm->prev_mi + idx_str; diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 6a14df4..bcc6236 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -539,6 +539,9 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) { int speed_multiplier = speed + 1; int i; + if (speed == 2) + speed_multiplier = 1; + // Set baseline threshold values for (i = 0; i < MAX_MODES; ++i) sf->thresh_mult[i] = mode == 0 ? -500 : 0; @@ -595,18 +598,21 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) { for (i = 0; i < MAX_MODES; ++i) sf->thresh_mult[i] = INT_MAX; - sf->thresh_mult[THR_DC ] = 0; - sf->thresh_mult[THR_TM ] = 0; - sf->thresh_mult[THR_NEWMV ] = 4000; - sf->thresh_mult[THR_NEWG ] = 4000; - sf->thresh_mult[THR_NEWA ] = 4000; + sf->thresh_mult[THR_DC] = 0; + sf->thresh_mult[THR_TM] = 0; + sf->thresh_mult[THR_NEWMV] = 4000; + sf->thresh_mult[THR_NEWG] = 4000; + sf->thresh_mult[THR_NEWA] = 4000; sf->thresh_mult[THR_NEARESTMV] = 0; - sf->thresh_mult[THR_NEARESTG ] = 0; - sf->thresh_mult[THR_NEARESTA ] = 0; - sf->thresh_mult[THR_NEARMV ] = 2000; - sf->thresh_mult[THR_NEARG ] = 2000; - sf->thresh_mult[THR_NEARA ] = 2000; + sf->thresh_mult[THR_NEARESTG] = 0; + sf->thresh_mult[THR_NEARESTA] = 0; + sf->thresh_mult[THR_NEARMV] = 2000; + sf->thresh_mult[THR_NEARG] = 2000; + sf->thresh_mult[THR_NEARA] = 2000; sf->thresh_mult[THR_COMP_NEARESTLA] = 2000; + sf->thresh_mult[THR_SPLITMV] = 2500; + sf->thresh_mult[THR_SPLITG] = 2500; + sf->thresh_mult[THR_SPLITA] = 2500; sf->recode_loop = 0; } @@ -681,6 +687,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->max_step_search_steps = MAX_MVSEARCH_STEPS; sf->comp_inter_joint_search_thresh = BLOCK_SIZE_AB4X4; sf->adpative_rd_thresh = 0; + sf->use_lastframe_partitioning = 0; #if CONFIG_MULTIPLE_ARF // Switch segmentation off. @@ -708,7 +715,10 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->optimize_coefficients = 0; sf->first_step = 1; } - break; + if (speed == 2) + sf->use_lastframe_partitioning = 1; + + break; }; /* switch */ @@ -3327,7 +3337,7 @@ static void Pass2Encode(VP9_COMP *cpi, unsigned long *size, vp9_second_pass(cpi); encode_frame_to_data_rate(cpi, size, dest, frame_flags); - + //vp9_print_modes_and_motion_vectors(&cpi->common, "encode.stt"); #ifdef DISABLE_RC_LONG_TERM_MEM cpi->twopass.bits_left -= cpi->this_frame_target; #else diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h index f5f1c07..6d09dcc 100644 --- a/vp9/encoder/vp9_onyx_int.h +++ b/vp9/encoder/vp9_onyx_int.h @@ -216,6 +216,7 @@ typedef struct { int static_segmentation; int comp_inter_joint_search_thresh; int adpative_rd_thresh; + int use_lastframe_partitioning; } SPEED_FEATURES; enum BlockSize { -- 2.7.4