]> granicus.if.org Git - libvpx/commitdiff
Add build_inter_mode_cost()
authorAngie Chiang <angiebird@google.com>
Fri, 8 Mar 2019 03:45:51 +0000 (19:45 -0800)
committerAngie Chiang <angiebird@google.com>
Tue, 9 Apr 2019 22:13:27 +0000 (15:13 -0700)
Change-Id: I4e5ed327e39cef1dd8c1a8f55fcbe90a5181814d

vp9/encoder/vp9_rd.c
vp9/encoder/vp9_rd.h

index 894b1497b3bdc8131351227aa83d8f8e4f5e7b25..5955451fd3a260250064faf901b9b5062688c8fb 100644 (file)
@@ -309,6 +309,15 @@ static void set_block_thresholds(const VP9_COMMON *cm, RD_OPT *rd) {
   }
 }
 
+void vp9_build_inter_mode_cost(VP9_COMP *cpi) {
+  const VP9_COMMON *const cm = &cpi->common;
+  int i;
+  for (i = 0; i < INTER_MODE_CONTEXTS; ++i) {
+    vp9_cost_tokens((int *)cpi->inter_mode_cost[i], cm->fc->inter_mode_probs[i],
+                    vp9_inter_mode_tree);
+  }
+}
+
 void vp9_initialize_rd_consts(VP9_COMP *cpi) {
   VP9_COMMON *const cm = &cpi->common;
   MACROBLOCK *const x = &cpi->td.mb;
@@ -357,10 +366,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi) {
             x->nmvjointcost,
             cm->allow_high_precision_mv ? x->nmvcost_hp : x->nmvcost,
             &cm->fc->nmvc, cm->allow_high_precision_mv);
-
-        for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
-          vp9_cost_tokens((int *)cpi->inter_mode_cost[i],
-                          cm->fc->inter_mode_probs[i], vp9_inter_mode_tree);
+        vp9_build_inter_mode_cost(cpi);
       }
     }
   }
index 21f8ddd379656b6db9439d3e2b9b3f7b1f475a77..f948f5ba2f1f65a35f7a53eec7468e2eb481fa18 100644 (file)
@@ -217,6 +217,8 @@ unsigned int vp9_high_get_sby_perpixel_variance(struct VP9_COMP *cpi,
                                                 BLOCK_SIZE bs, int bd);
 #endif
 
+void vp9_build_inter_mode_cost(struct VP9_COMP *cpi);
+
 #ifdef __cplusplus
 }  // extern "C"
 #endif