]> granicus.if.org Git - libvpx/commitdiff
vp10: allow bw adaptivity for skip/tx probabilities in keyframes.
authorRonald S. Bultje <rsbultje@gmail.com>
Thu, 1 Oct 2015 14:32:57 +0000 (10:32 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Mon, 12 Oct 2015 21:51:01 +0000 (17:51 -0400)
See issue 1040 point 3.

Change-Id: Ieef6d326b7fb50ceca5936525b7c688225a11fd1

vp10/common/entropymode.c
vp10/common/entropymode.h
vp10/decoder/decodeframe.c
vp10/encoder/encoder.c

index 009f1c913b7f466b4d5b1083343cd614e315bbc1..d379861e0923e07b2ff3c3ea1328eda4d91ed831 100644 (file)
@@ -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;
index a8b749253c806f9b69eb180ba9ee7d50ccec87bc..31f72db187b3d99f9384bde0e8775b78d4e17d46 100644 (file)
@@ -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]);
index ad02c953ef9861b88ba213411f537ed8d504b917..248912ded91b1253036f51331d64c3a52d98188e 100644 (file)
@@ -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 {
index a38e1829e14e5bbcc01af586d3b712ce9369b467..54a28d49d6cd0e941429fc64e9faea4c9c24c68d 100644 (file)
@@ -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);
     }
   }