Merge MISC_FIXES

Remove MISC_FIXES flags except for the changes on MV precision, which
has a 0.1% performance drop.

On derflr, the impact is -0.012%.

Change-Id: I0a74e5a212dd0cb827192a318c92a714c9681e45
This commit is contained in:
hui su
2015-11-16 16:58:15 -08:00
parent 5f9e089b1d
commit 66f2f65ef7
27 changed files with 30 additions and 977 deletions

View File

@@ -58,9 +58,7 @@ static void calc_segtree_probs(unsigned *segcounts,
segcounts[4] + segcounts[5], segcounts[6] + segcounts[7]
};
const unsigned ccc[2] = { cc[0] + cc[1], cc[2] + cc[3] };
#if CONFIG_MISC_FIXES
int i;
#endif
segment_tree_probs[0] = get_binary_prob(ccc[0], ccc[1]);
segment_tree_probs[1] = get_binary_prob(cc[0], cc[1]);
@@ -70,16 +68,12 @@ static void calc_segtree_probs(unsigned *segcounts,
segment_tree_probs[5] = get_binary_prob(segcounts[4], segcounts[5]);
segment_tree_probs[6] = get_binary_prob(segcounts[6], segcounts[7]);
#if CONFIG_MISC_FIXES
for (i = 0; i < 7; i++) {
const unsigned *ct = i == 0 ? ccc : i < 3 ? cc + (i & 2)
: segcounts + (i - 3) * 2;
vp10_prob_diff_update_savings_search(ct,
cur_tree_probs[i], &segment_tree_probs[i], DIFF_UPDATE_PROB);
}
#else
(void) cur_tree_probs;
#endif
}
// Based on set of segment counts and probabilities calculate a cost estimate
@@ -214,39 +208,22 @@ static void count_segs_sb(const VP10_COMMON *cm, MACROBLOCKD *xd,
void vp10_choose_segmap_coding_method(VP10_COMMON *cm, MACROBLOCKD *xd) {
struct segmentation *seg = &cm->seg;
#if CONFIG_MISC_FIXES
struct segmentation_probs *segp = &cm->fc->seg;
#else
struct segmentation_probs *segp = &cm->segp;
#endif
int no_pred_cost;
int t_pred_cost = INT_MAX;
int i, tile_col, mi_row, mi_col;
#if CONFIG_MISC_FIXES
unsigned (*temporal_predictor_count)[2] = cm->counts.seg.pred;
unsigned *no_pred_segcounts = cm->counts.seg.tree_total;
unsigned *t_unpred_seg_counts = cm->counts.seg.tree_mispred;
#else
unsigned temporal_predictor_count[PREDICTION_PROBS][2] = { { 0 } };
unsigned no_pred_segcounts[MAX_SEGMENTS] = { 0 };
unsigned t_unpred_seg_counts[MAX_SEGMENTS] = { 0 };
#endif
vpx_prob no_pred_tree[SEG_TREE_PROBS];
vpx_prob t_pred_tree[SEG_TREE_PROBS];
vpx_prob t_nopred_prob[PREDICTION_PROBS];
#if CONFIG_MISC_FIXES
(void) xd;
#else
// Set default state for the segment tree probabilities and the
// temporal coding probabilities
memset(segp->tree_probs, 255, sizeof(segp->tree_probs));
memset(segp->pred_probs, 255, sizeof(segp->pred_probs));
#endif
// First of all generate stats regarding how well the last segment map
// predicts this one
@@ -284,13 +261,9 @@ void vp10_choose_segmap_coding_method(VP10_COMMON *cm, MACROBLOCKD *xd) {
const int count0 = temporal_predictor_count[i][0];
const int count1 = temporal_predictor_count[i][1];
#if CONFIG_MISC_FIXES
vp10_prob_diff_update_savings_search(temporal_predictor_count[i],
segp->pred_probs[i],
&t_nopred_prob[i], DIFF_UPDATE_PROB);
#else
t_nopred_prob[i] = get_binary_prob(count0, count1);
#endif
// Add in the predictor signaling cost
t_pred_cost += count0 * vp10_cost_zero(t_nopred_prob[i]) +
@@ -301,30 +274,17 @@ void vp10_choose_segmap_coding_method(VP10_COMMON *cm, MACROBLOCKD *xd) {
// Now choose which coding method to use.
if (t_pred_cost < no_pred_cost) {
seg->temporal_update = 1;
#if !CONFIG_MISC_FIXES
memcpy(segp->tree_probs, t_pred_tree, sizeof(t_pred_tree));
memcpy(segp->pred_probs, t_nopred_prob, sizeof(t_nopred_prob));
#endif
} else {
seg->temporal_update = 0;
#if !CONFIG_MISC_FIXES
memcpy(segp->tree_probs, no_pred_tree, sizeof(no_pred_tree));
#endif
}
}
void vp10_reset_segment_features(VP10_COMMON *cm) {
struct segmentation *seg = &cm->seg;
#if !CONFIG_MISC_FIXES
struct segmentation_probs *segp = &cm->segp;
#endif
// Set up default state for MB feature flags
seg->enabled = 0;
seg->update_map = 0;
seg->update_data = 0;
#if !CONFIG_MISC_FIXES
memset(segp->tree_probs, 255, sizeof(segp->tree_probs));
#endif
vp10_clearall_segfeatures(seg);
}