summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2013-09-13 11:03:59 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-09-13 11:03:59 -0700
commit0c3038234d486c5228ecb8e29b65d05e820341a5 (patch)
tree7adaef9b131bb903e4e0c80599317068eb6c4fad
parent5d8642354e4e3715a314fd5f6bf4a0d495b4503b (diff)
parentb96464675611fae99fa67461eaae87e8ed2854cb (diff)
downloadlibvpx-0c3038234d486c5228ecb8e29b65d05e820341a5.tar.gz
Merge "Clean up of the search best filter speed feature"
-rw-r--r--vp9/encoder/vp9_onyx_if.c91
-rw-r--r--vp9/encoder/vp9_onyx_int.h1
2 files changed, 1 insertions, 91 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index a30598177..7e429f661 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -53,10 +53,6 @@ static void set_default_lf_deltas(struct loopfilter *lf);
#define DEFAULT_INTERP_FILTER SWITCHABLE
-#define SEARCH_BEST_FILTER 0 /* to search exhaustively for
- best filter */
-#define RESET_FOREACH_FILTER 0 /* whether to reset the encoder state
- before trying each new filter */
#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */
#define ALTREF_HIGH_PRECISION_MV 1 /* whether to use high precision mv
@@ -753,7 +749,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
switch (mode) {
case 0: // best quality mode
- sf->search_best_filter = SEARCH_BEST_FILTER;
break;
case 1:
@@ -2582,24 +2577,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
SPEED_FEATURES *sf = &cpi->sf;
unsigned int max_mv_def = MIN(cpi->common.width, cpi->common.height);
struct segmentation *seg = &cm->seg;
-#if RESET_FOREACH_FILTER
- int q_low0;
- int q_high0;
- int Q0;
- int active_best_quality0;
- int active_worst_quality0;
- double rate_correction_factor0;
- double gf_rate_correction_factor0;
-#endif
-
- /* list of filters to search over */
- int mcomp_filters_to_search[] = {
- EIGHTTAP, EIGHTTAP_SHARP, EIGHTTAP_SMOOTH, SWITCHABLE
- };
- int mcomp_filters = sizeof(mcomp_filters_to_search) /
- sizeof(*mcomp_filters_to_search);
- int mcomp_filter_index = 0;
- int64_t mcomp_filter_cost[4];
/* Scale the source buffer, if required */
if (cm->mi_cols * 8 != cpi->un_scaled_source->y_width ||
@@ -2911,13 +2888,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
vp9_zero(cpi->rd_tx_select_threshes);
if (cm->frame_type != KEY_FRAME) {
- /* TODO: Decide this more intelligently */
- if (sf->search_best_filter) {
- cm->mcomp_filter_type = mcomp_filters_to_search[0];
- mcomp_filter_index = 0;
- } else {
- cm->mcomp_filter_type = DEFAULT_INTERP_FILTER;
- }
+ cm->mcomp_filter_type = DEFAULT_INTERP_FILTER;
/* TODO: Decide this more intelligently */
xd->allow_high_precision_mv = q < HIGH_PRECISION_MV_QTHRESH;
set_mvcost(&cpi->mb);
@@ -2956,17 +2927,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
vp9_write_yuv_frame(cpi->Source);
#endif
-#if RESET_FOREACH_FILTER
- if (sf->search_best_filter) {
- q_low0 = q_low;
- q_high0 = q_high;
- Q0 = Q;
- rate_correction_factor0 = cpi->rate_correction_factor;
- gf_rate_correction_factor0 = cpi->gf_rate_correction_factor;
- active_best_quality0 = cpi->active_best_quality;
- active_worst_quality0 = cpi->active_worst_quality;
- }
-#endif
do {
vp9_clear_system_state(); // __asm emms;
@@ -3145,55 +3105,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
if (cpi->is_src_frame_alt_ref)
loop = 0;
- if (!loop && cm->frame_type != KEY_FRAME && sf->search_best_filter) {
- if (mcomp_filter_index < mcomp_filters) {
- int64_t err = vp9_calc_ss_err(cpi->Source,
- &cm->yv12_fb[cm->new_fb_idx]);
- int64_t rate = cpi->projected_frame_size << 8;
- mcomp_filter_cost[mcomp_filter_index] =
- (RDCOST(cpi->RDMULT, cpi->RDDIV, rate, err));
- mcomp_filter_index++;
- if (mcomp_filter_index < mcomp_filters) {
- cm->mcomp_filter_type = mcomp_filters_to_search[mcomp_filter_index];
- loop_count = -1;
- loop = 1;
- } else {
- int f;
- int64_t best_cost = mcomp_filter_cost[0];
- int mcomp_best_filter = mcomp_filters_to_search[0];
- for (f = 1; f < mcomp_filters; f++) {
- if (mcomp_filter_cost[f] < best_cost) {
- mcomp_best_filter = mcomp_filters_to_search[f];
- best_cost = mcomp_filter_cost[f];
- }
- }
- if (mcomp_best_filter != mcomp_filters_to_search[mcomp_filters - 1]) {
- loop_count = -1;
- loop = 1;
- cm->mcomp_filter_type = mcomp_best_filter;
- }
- /*
- printf(" best filter = %d, ( ", mcomp_best_filter);
- for (f=0;f<mcomp_filters; f++) printf("%d ", mcomp_filter_cost[f]);
- printf(")\n");
- */
- }
-#if RESET_FOREACH_FILTER
- if (loop) {
- overshoot_seen = 0;
- undershoot_seen = 0;
- q_low = q_low0;
- q_high = q_high0;
- q = Q0;
- cpi->rate_correction_factor = rate_correction_factor0;
- cpi->gf_rate_correction_factor = gf_rate_correction_factor0;
- cpi->active_best_quality = active_best_quality0;
- cpi->active_worst_quality = active_worst_quality0;
- }
-#endif
- }
- }
-
if (loop) {
loop_count++;
diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h
index 18e540a56..66da026e3 100644
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -258,7 +258,6 @@ typedef struct {
int reduce_first_step_size;
int auto_mv_step_size;
int optimize_coefficients;
- int search_best_filter;
int static_segmentation;
int comp_inter_joint_search_thresh;
int adaptive_rd_thresh;