From: Ronald S. Bultje Date: Thu, 1 Oct 2015 14:32:57 +0000 (-0400) Subject: vp10: allow bw adaptivity for skip/tx probabilities in keyframes. X-Git-Tag: v1.5.0~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f589826f3e220f205a3cee2b441fab19464ffa7;p=libvpx vp10: allow bw adaptivity for skip/tx probabilities in keyframes. See issue 1040 point 3. Change-Id: Ieef6d326b7fb50ceca5936525b7c688225a11fd1 --- diff --git a/vp10/common/entropymode.c b/vp10/common/entropymode.c index 009f1c913..d379861e0 100644 --- a/vp10/common/entropymode.c +++ b/vp10/common/entropymode.c @@ -334,7 +334,7 @@ const vpx_tree_index vp10_switchable_interp_tree -EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP }; -void vp10_adapt_mode_probs(VP10_COMMON *cm) { +void vp10_adapt_inter_frame_probs(VP10_COMMON *cm) { int i, j; FRAME_CONTEXT *fc = cm->fc; const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx]; @@ -377,6 +377,13 @@ void vp10_adapt_mode_probs(VP10_COMMON *cm) { counts->switchable_interp[i], fc->switchable_interp_prob[i]); } +} + +void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) { + int i; + FRAME_CONTEXT *fc = cm->fc; + const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx]; + const FRAME_COUNTS *counts = &cm->counts; if (cm->tx_mode == TX_MODE_SELECT) { int j; diff --git a/vp10/common/entropymode.h b/vp10/common/entropymode.h index a8b749253..31f72db18 100644 --- a/vp10/common/entropymode.h +++ b/vp10/common/entropymode.h @@ -91,7 +91,8 @@ extern const vpx_tree_index vp10_switchable_interp_tree void vp10_setup_past_independence(struct VP10Common *cm); -void vp10_adapt_mode_probs(struct VP10Common *cm); +void vp10_adapt_intra_frame_probs(struct VP10Common *cm); +void vp10_adapt_inter_frame_probs(struct VP10Common *cm); void vp10_tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p, unsigned int (*ct_32x32p)[2]); diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c index ad02c953e..248912ded 100644 --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@ -2330,9 +2330,15 @@ void vp10_decode_frame(VP10Decoder *pbi, if (!xd->corrupted) { if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) { vp10_adapt_coef_probs(cm); +#if CONFIG_MISC_FIXES + vp10_adapt_intra_frame_probs(cm); +#endif if (!frame_is_intra_only(cm)) { - vp10_adapt_mode_probs(cm); +#if !CONFIG_MISC_FIXES + vp10_adapt_intra_frame_probs(cm); +#endif + vp10_adapt_inter_frame_probs(cm); vp10_adapt_mv_probs(cm, cm->allow_high_precision_mv); } } else { diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c index a38e1829e..54a28d49d 100644 --- a/vp10/encoder/encoder.c +++ b/vp10/encoder/encoder.c @@ -3653,12 +3653,19 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi, full_to_model_counts(cpi->td.counts->coef[t], cpi->td.rd_counts.coef_counts[t]); - if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) + if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) { vp10_adapt_coef_probs(cm); +#if CONFIG_MISC_FIXES + vp10_adapt_intra_frame_probs(cm); +#else + if (!frame_is_intra_only(cm)) + vp10_adapt_intra_frame_probs(cm); +#endif + } if (!frame_is_intra_only(cm)) { if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) { - vp10_adapt_mode_probs(cm); + vp10_adapt_inter_frame_probs(cm); vp10_adapt_mv_probs(cm, cm->allow_high_precision_mv); } }