From b2446fb6be2d51fdeda6818221c6273ffd8213c1 Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Mon, 27 Jul 2015 11:58:39 -0700 Subject: [PATCH] Remove tx_select_threshes Removed unused tx_select_threshes and tx_select_diff. Change-Id: I5e9e7ad170056efe14b5f071e94d0c5a36e4a34c --- vp9/encoder/vp9_encodeframe.c | 17 ----------------- vp9/encoder/vp9_encoder.h | 1 - vp9/encoder/vp9_ethread.c | 3 --- vp9/encoder/vp9_rd.h | 2 -- 4 files changed, 23 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index a45094571..658a11c26 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1059,11 +1059,6 @@ static void update_state(VP9_COMP *cpi, ThreadData *td, if (!output_enabled) return; - if (!segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { - for (i = 0; i < TX_MODES; i++) - rdc->tx_select_diff[i] += ctx->tx_rd_diff[i]; - } - #if CONFIG_INTERNAL_STATS if (frame_is_intra_only(cm)) { static const int kf_mode_index[] = { @@ -3869,7 +3864,6 @@ static int input_fpmb_stats(FIRSTPASS_MB_STATS *firstpass_mb_stats, static void encode_frame_internal(VP9_COMP *cpi) { SPEED_FEATURES *const sf = &cpi->sf; - RD_OPT *const rd_opt = &cpi->rd; ThreadData *const td = &cpi->td; MACROBLOCK *const x = &td->mb; VP9_COMMON *const cm = &cpi->common; @@ -3883,8 +3877,6 @@ static void encode_frame_internal(VP9_COMP *cpi) { vp9_zero(rdc->coef_counts); vp9_zero(rdc->comp_pred_diff); vp9_zero(rdc->filter_diff); - vp9_zero(rdc->tx_select_diff); - vp9_zero(rd_opt->tx_select_threshes); xd->lossless = cm->base_qindex == 0 && cm->y_dc_delta_q == 0 && @@ -4034,7 +4026,6 @@ void vp9_encode_frame(VP9_COMP *cpi) { const MV_REFERENCE_FRAME frame_type = get_frame_type(cpi); int64_t *const mode_thrs = rd_opt->prediction_type_threshes[frame_type]; int64_t *const filter_thrs = rd_opt->filter_threshes[frame_type]; - int *const tx_thrs = rd_opt->tx_select_threshes[frame_type]; const int is_alt_ref = frame_type == ALTREF_FRAME; /* prediction (compound, single or hybrid) mode selection */ @@ -4062,14 +4053,6 @@ void vp9_encode_frame(VP9_COMP *cpi) { for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) filter_thrs[i] = (filter_thrs[i] + rdc->filter_diff[i] / cm->MBs) / 2; - for (i = 0; i < TX_MODES; ++i) { - int64_t pd = rdc->tx_select_diff[i]; - if (i == TX_MODE_SELECT) - pd -= RDCOST(cpi->td.mb.rdmult, cpi->td.mb.rddiv, 2048 * (TX_SIZES - 1), - 0); - tx_thrs[i] = (tx_thrs[i] + (int)(pd / cm->MBs)) / 2; - } - if (cm->reference_mode == REFERENCE_MODE_SELECT) { int single_count_zero = 0; int comp_count_zero = 0; diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index b76b6b713..4d4da9283 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -255,7 +255,6 @@ typedef struct TileDataEnc { typedef struct RD_COUNTS { vp9_coeff_count coef_counts[TX_SIZES][PLANE_TYPES]; int64_t comp_pred_diff[REFERENCE_MODES]; - int64_t tx_select_diff[TX_MODES]; int64_t filter_diff[SWITCHABLE_FILTER_CONTEXTS]; } RD_COUNTS; diff --git a/vp9/encoder/vp9_ethread.c b/vp9/encoder/vp9_ethread.c index b4132d815..00025b7a1 100644 --- a/vp9/encoder/vp9_ethread.c +++ b/vp9/encoder/vp9_ethread.c @@ -21,9 +21,6 @@ static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) { for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) td->rd_counts.filter_diff[i] += td_t->rd_counts.filter_diff[i]; - for (i = 0; i < TX_MODES; i++) - td->rd_counts.tx_select_diff[i] += td_t->rd_counts.tx_select_diff[i]; - for (i = 0; i < TX_SIZES; i++) for (j = 0; j < PLANE_TYPES; j++) for (k = 0; k < REF_TYPES; k++) diff --git a/vp9/encoder/vp9_rd.h b/vp9/encoder/vp9_rd.h index 7ba2568fe..28385c981 100644 --- a/vp9/encoder/vp9_rd.h +++ b/vp9/encoder/vp9_rd.h @@ -103,8 +103,6 @@ typedef struct RD_OPT { int threshes[MAX_SEGMENTS][BLOCK_SIZES][MAX_MODES]; int64_t prediction_type_threshes[MAX_REF_FRAMES][REFERENCE_MODES]; - // TODO(agrange): can this overflow? - int tx_select_threshes[MAX_REF_FRAMES][TX_MODES]; int64_t filter_threshes[MAX_REF_FRAMES][SWITCHABLE_FILTER_CONTEXTS];