ref: 5f589826f3e220f205a3cee2b441fab19464ffa7
parent: fee146e60b1143a2434ff3695083155618240645
author: Ronald S. Bultje <[email protected]>
date: Thu Oct 1 06:32:57 EDT 2015
vp10: allow bw adaptivity for skip/tx probabilities in keyframes. See issue 1040 point 3. Change-Id: Ieef6d326b7fb50ceca5936525b7c688225a11fd1
--- a/vp10/common/entropymode.c
+++ b/vp10/common/entropymode.c
@@ -334,7 +334,7 @@
-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 @@
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;
--- a/vp10/common/entropymode.h
+++ b/vp10/common/entropymode.h
@@ -91,7 +91,8 @@
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]);
--- a/vp10/decoder/decodeframe.c
+++ b/vp10/decoder/decodeframe.c
@@ -2330,9 +2330,15 @@
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 {
--- a/vp10/encoder/encoder.c
+++ b/vp10/encoder/encoder.c
@@ -3653,12 +3653,19 @@
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);
}
}