Commit f330444a authored by Angie Chiang's avatar Angie Chiang Committed by Gerrit Code Review

Merge "remove filter_cache" into nextgenv2

parents c2005c57 b6fef124
......@@ -54,7 +54,6 @@ typedef struct {
int hybrid_pred_diff;
int comp_pred_diff;
int single_pred_diff;
int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS];
// TODO(jingning) Use RD_COST struct here instead. This involves a boarder
// scope of refactoring.
......
......@@ -1194,9 +1194,6 @@ static void update_state(VP10_COMP *cpi, ThreadData *td,
rdc->comp_pred_diff[SINGLE_REFERENCE] += ctx->single_pred_diff;
rdc->comp_pred_diff[COMPOUND_REFERENCE] += ctx->comp_pred_diff;
rdc->comp_pred_diff[REFERENCE_MODE_SELECT] += ctx->hybrid_pred_diff;
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
rdc->filter_diff[i] += ctx->best_filter_diff[i];
}
for (h = 0; h < y_mis; ++h) {
......@@ -1316,9 +1313,6 @@ static void update_state_supertx(VP10_COMP *cpi, ThreadData *td,
rdc->comp_pred_diff[SINGLE_REFERENCE] += ctx->single_pred_diff;
rdc->comp_pred_diff[COMPOUND_REFERENCE] += ctx->comp_pred_diff;
rdc->comp_pred_diff[REFERENCE_MODE_SELECT] += ctx->hybrid_pred_diff;
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
rdc->filter_diff[i] += ctx->best_filter_diff[i];
}
for (h = 0; h < y_mis; ++h) {
......@@ -3962,7 +3956,6 @@ static void encode_frame_internal(VP10_COMP *cpi) {
vp10_zero(*td->counts);
vp10_zero(rdc->coef_counts);
vp10_zero(rdc->comp_pred_diff);
vp10_zero(rdc->filter_diff);
rdc->m_search_count = 0; // Count of motion search hits.
rdc->ex_search_count = 0; // Exhaustive mesh search hits.
......@@ -4030,31 +4023,9 @@ static void encode_frame_internal(VP10_COMP *cpi) {
cpi->last_frame_distortion = cpi->frame_distortion;
#endif
}
static INTERP_FILTER get_interp_filter(
const int64_t threshes[SWITCHABLE_FILTER_CONTEXTS], int is_alt_ref) {
#if CONFIG_EXT_INTERP
if (!is_alt_ref &&
threshes[EIGHTTAP_SMOOTH2] > threshes[EIGHTTAP_SMOOTH] &&
threshes[EIGHTTAP_SMOOTH2] > threshes[EIGHTTAP_REGULAR] &&
threshes[EIGHTTAP_SMOOTH2] > threshes[MULTITAP_SHARP] &&
threshes[EIGHTTAP_SMOOTH2] > threshes[SWITCHABLE - 1]) {
return EIGHTTAP_SMOOTH2;
}
#endif // CONFIG_EXT_INTERP
if (!is_alt_ref &&
threshes[EIGHTTAP_SMOOTH] > threshes[EIGHTTAP_REGULAR] &&
threshes[EIGHTTAP_SMOOTH] > threshes[MULTITAP_SHARP] &&
threshes[EIGHTTAP_SMOOTH] > threshes[SWITCHABLE - 1]) {
return EIGHTTAP_SMOOTH;
} else if (threshes[MULTITAP_SHARP] > threshes[EIGHTTAP_REGULAR] &&
threshes[MULTITAP_SHARP] > threshes[SWITCHABLE - 1]) {
return MULTITAP_SHARP;
} else if (threshes[EIGHTTAP_REGULAR] > threshes[SWITCHABLE - 1]) {
return EIGHTTAP_REGULAR;
} else {
return SWITCHABLE;
}
static INTERP_FILTER get_cm_interp_filter(VP10_COMP *cpi) {
(void)cpi;
return SWITCHABLE;
}
void vp10_encode_frame(VP10_COMP *cpi) {
......@@ -4107,7 +4078,6 @@ void vp10_encode_frame(VP10_COMP *cpi) {
// INTRA/ALTREF/GOLDEN/LAST needs to be specified seperately.
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];
const int is_alt_ref = frame_type == ALTREF_FRAME;
/* prediction (compound, single or hybrid) mode selection */
......@@ -4125,7 +4095,7 @@ void vp10_encode_frame(VP10_COMP *cpi) {
cm->reference_mode = REFERENCE_MODE_SELECT;
if (cm->interp_filter == SWITCHABLE) {
cm->interp_filter = get_interp_filter(filter_thrs, is_alt_ref);
cm->interp_filter = get_cm_interp_filter(cpi);
}
encode_frame_internal(cpi);
......@@ -4133,9 +4103,6 @@ void vp10_encode_frame(VP10_COMP *cpi) {
for (i = 0; i < REFERENCE_MODES; ++i)
mode_thrs[i] = (mode_thrs[i] + rdc->comp_pred_diff[i] / cm->MBs) / 2;
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
filter_thrs[i] = (filter_thrs[i] + rdc->filter_diff[i] / cm->MBs) / 2;
if (cm->reference_mode == REFERENCE_MODE_SELECT) {
int single_count_zero = 0;
int comp_count_zero = 0;
......
......@@ -251,7 +251,6 @@ typedef struct TileDataEnc {
typedef struct RD_COUNTS {
vp10_coeff_count coef_counts[TX_SIZES][PLANE_TYPES];
int64_t comp_pred_diff[REFERENCE_MODES];
int64_t filter_diff[SWITCHABLE_FILTER_CONTEXTS];
int m_search_count;
int ex_search_count;
} RD_COUNTS;
......
......@@ -19,9 +19,6 @@ static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) {
for (i = 0; i < REFERENCE_MODES; i++)
td->rd_counts.comp_pred_diff[i] += td_t->rd_counts.comp_pred_diff[i];
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_SIZES; i++)
for (j = 0; j < PLANE_TYPES; j++)
for (k = 0; k < REF_TYPES; k++)
......
......@@ -279,8 +279,6 @@ typedef struct RD_OPT {
int64_t prediction_type_threshes[MAX_REF_FRAMES][REFERENCE_MODES];
int64_t filter_threshes[MAX_REF_FRAMES][SWITCHABLE_FILTER_CONTEXTS];
int RDMULT;
int RDDIV;
} RD_OPT;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment