From: Dmitry Kovalev <dkovalev@google.com> Date: Wed, 24 Jul 2013 17:31:07 +0000 (-0700) Subject: Removing vp9_adapt_mode_context function. X-Git-Tag: v1.3.0~741^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47d61f008fd9f97dc01395d110a55f297f777578;p=libvpx Removing vp9_adapt_mode_context function. Moving code from vp9_adapt_mode_context to vp9_adapt_mode_probs. Change-Id: I60829c30b28968cd813551ef3a206dfb98d323c9 --- diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index ca188e438..cd864cf07 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -393,18 +393,6 @@ static int update_ct2(vp9_prob pre_prob, unsigned int ct[2]) { return update_ct(pre_prob, get_binary_prob(ct[0], ct[1]), ct); } -void vp9_adapt_mode_context(VP9_COMMON *pc) { - int i, j; - FRAME_CONTEXT *const fc = &pc->fc; - FRAME_CONTEXT *const pre_fc = &pc->frame_contexts[pc->frame_context_idx]; - FRAME_COUNTS *const counts = &pc->counts; - - for (j = 0; j < INTER_MODE_CONTEXTS; j++) - for (i = 0; i < VP9_INTER_MODES - 1; i++) - fc->inter_mode_probs[j][i] = update_ct2(pre_fc->inter_mode_probs[j][i], - counts->inter_mode[j][i]); -} - static void update_mode_probs(int n_modes, const vp9_tree_index *tree, unsigned int *cnt, vp9_prob *pre_probs, vp9_prob *dst_probs, @@ -440,6 +428,10 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) { fc->single_ref_prob[i][j] = update_ct2(pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]); + for (j = 0; j < INTER_MODE_CONTEXTS; j++) + for (i = 0; i < VP9_INTER_MODES - 1; i++) + fc->inter_mode_probs[j][i] = update_ct2(pre_fc->inter_mode_probs[j][i], + counts->inter_mode[j][i]); for (i = 0; i < BLOCK_SIZE_GROUPS; i++) update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree, counts->y_mode[i], pre_fc->y_mode_prob[i], diff --git a/vp9/common/vp9_entropymode.h b/vp9/common/vp9_entropymode.h index 8c14e7e17..a71585a92 100644 --- a/vp9/common/vp9_entropymode.h +++ b/vp9/common/vp9_entropymode.h @@ -67,8 +67,6 @@ void vp9_setup_past_independence(struct VP9Common *cm, MACROBLOCKD *xd); void vp9_init_mbmode_probs(struct VP9Common *x); -void vp9_adapt_mode_context(struct VP9Common *pc); - void vp9_adapt_mode_probs(struct VP9Common *); void vp9_accum_mv_refs(struct VP9Common *pc, MB_PREDICTION_MODE m, int context); diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index ffec8ea44..f5086d668 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -994,7 +994,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) { if (!keyframe && !pc->intra_only) { vp9_adapt_mode_probs(pc); - vp9_adapt_mode_context(pc); vp9_adapt_mv_probs(pc, xd->allow_high_precision_mv); } } diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index e5f1a5c2c..fc19bd951 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -3173,7 +3173,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, if (!cpi->common.error_resilient_mode && !cpi->common.frame_parallel_decoding_mode) { vp9_adapt_mode_probs(&cpi->common); - vp9_adapt_mode_context(&cpi->common); vp9_adapt_mv_probs(&cpi->common, cpi->mb.e_mbd.allow_high_precision_mv); } }