From 45425f8c1e2234de6f769c60d2d36b2361706df0 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 21 Aug 2014 11:30:52 -0700 Subject: Removing is_best_mode() function. Change-Id: Iccd7cec885e8aeb0e54613d888f9960c393cee0b --- vp9/encoder/vp9_encoder.h | 4 ---- vp9/encoder/vp9_rd.c | 4 ++-- vp9/encoder/vp9_rdopt.c | 4 ++-- vp9/encoder/vp9_speed_features.c | 12 +++++------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index 82be0f4b6..389f287da 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -223,10 +223,6 @@ static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; } -static INLINE int is_best_mode(MODE mode) { - return mode == BEST; -} - typedef struct VP9_COMP { QUANTS quants; MACROBLOCK mb; diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c index 4fc3e9e08..2841efabe 100644 --- a/vp9/encoder/vp9_rd.c +++ b/vp9/encoder/vp9_rd.c @@ -462,7 +462,7 @@ void vp9_set_rd_speed_thresholds(VP9_COMP *cpi) { // Set baseline threshold values. for (i = 0; i < MAX_MODES; ++i) - rd->thresh_mult[i] = is_best_mode(cpi->oxcf.mode) ? -500 : 0; + rd->thresh_mult[i] = cpi->oxcf.mode == BEST ? -500 : 0; rd->thresh_mult[THR_NEARESTMV] = 0; rd->thresh_mult[THR_NEARESTG] = 0; @@ -548,7 +548,7 @@ void vp9_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) { int i; for (i = 0; i < MAX_REFS; ++i) - rd->thresh_mult_sub8x8[i] = is_best_mode(cpi->oxcf.mode) ? -500 : 0; + rd->thresh_mult_sub8x8[i] = cpi->oxcf.mode == BEST ? -500 : 0; rd->thresh_mult_sub8x8[THR_LAST] += 2500; rd->thresh_mult_sub8x8[THR_GOLD] += 2500; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index cfda964ce..a2d89e7dd 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1371,7 +1371,7 @@ static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x, if (best_rd < label_mv_thresh) break; - if (!is_best_mode(cpi->oxcf.mode)) { + if (cpi->oxcf.mode != BEST) { // use previous block's result as next block's MV predictor. if (i > 0) { bsi->mvp.as_int = mi->bmi[i - 1].as_mv[0].as_int; @@ -1413,7 +1413,7 @@ static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x, INT_MAX, 1); // Should we do a full search (best quality only) - if (is_best_mode(cpi->oxcf.mode)) { + if (cpi->oxcf.mode == BEST) { int_mv *const best_mv = &mi->bmi[i].as_mv[0]; /* Check if mvp_full is within the range. */ clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max, diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 57835ec3d..d42711147 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -408,16 +408,14 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->default_interp_filter = SWITCHABLE; sf->tx_size_search_breakout = 0; - if (oxcf->mode == REALTIME) { + if (oxcf->mode == REALTIME) set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content); - } else { - if (!is_best_mode(oxcf->mode)) - set_good_speed_feature(cpi, cm, sf, oxcf->speed); - } + else if (oxcf->mode == GOOD) + set_good_speed_feature(cpi, cm, sf, oxcf->speed); cpi->full_search_sad = vp9_full_search_sad; - cpi->diamond_search_sad = is_best_mode(oxcf->mode) ? vp9_full_range_search - : vp9_diamond_search_sad; + cpi->diamond_search_sad = oxcf->mode == BEST ? vp9_full_range_search + : vp9_diamond_search_sad; cpi->refining_search_sad = vp9_refining_search_sad; -- cgit v1.2.3