]> granicus.if.org Git - libvpx/commitdiff
vp9_pred_common: inline vp9_get_tx_size_context
authorJames Zern <jzern@google.com>
Tue, 16 Jun 2015 00:31:38 +0000 (17:31 -0700)
committerJames Zern <jzern@google.com>
Tue, 16 Jun 2015 01:41:22 +0000 (18:41 -0700)
+ drop 'vp9_' prefix

Change-Id: If3f3ec32d03026af78b8fcd82749e587a3f43059

vp9/common/vp9_pred_common.c
vp9/common/vp9_pred_common.h
vp9/decoder/vp9_decodemv.c
vp9/encoder/vp9_encodeframe.c

index a24e9500385b9f3d2e4f866b567b54d6ad408a3c..1f16325732b0161a30ae35ae8ecb89b295a31f83 100644 (file)
@@ -337,26 +337,3 @@ int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
   assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
   return pred_context;
 }
-// Returns a context number for the given MB prediction signal
-// The mode info data structure has a one element border above and to the
-// left of the entries corresponding to real blocks.
-// The prediction flags in these dummy entries are initialized to 0.
-int vp9_get_tx_size_context(const MACROBLOCKD *xd) {
-  const int max_tx_size = max_txsize_lookup[xd->mi[0]->mbmi.sb_type];
-  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
-  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
-  const int has_above = xd->up_available;
-  const int has_left = xd->left_available;
-  int above_ctx = (has_above && !above_mbmi->skip) ? (int)above_mbmi->tx_size
-                                                   : max_tx_size;
-  int left_ctx = (has_left && !left_mbmi->skip) ? (int)left_mbmi->tx_size
-                                                : max_tx_size;
-  if (!has_left)
-    left_ctx = above_ctx;
-
-  if (!has_above)
-    above_ctx = left_ctx;
-
-  return (above_ctx + left_ctx) > max_tx_size;
-}
-
index 7ea8c9da3c597238ce10e3d4cdd0fcfa52bb092f..76161444b9a75aadf2bfb5b9a61d3ea390b46d01 100644 (file)
@@ -104,7 +104,28 @@ static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
   return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1];
 }
 
-int vp9_get_tx_size_context(const MACROBLOCKD *xd);
+// Returns a context number for the given MB prediction signal
+// The mode info data structure has a one element border above and to the
+// left of the entries corresponding to real blocks.
+// The prediction flags in these dummy entries are initialized to 0.
+static INLINE int get_tx_size_context(const MACROBLOCKD *xd) {
+  const int max_tx_size = max_txsize_lookup[xd->mi[0]->mbmi.sb_type];
+  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
+  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
+  const int has_above = xd->up_available;
+  const int has_left = xd->left_available;
+  int above_ctx = (has_above && !above_mbmi->skip) ? (int)above_mbmi->tx_size
+                                                   : max_tx_size;
+  int left_ctx = (has_left && !left_mbmi->skip) ? (int)left_mbmi->tx_size
+                                                : max_tx_size;
+  if (!has_left)
+    left_ctx = above_ctx;
+
+  if (!has_above)
+    above_ctx = left_ctx;
+
+  return (above_ctx + left_ctx) > max_tx_size;
+}
 
 static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
                                            const struct tx_probs *tx_probs) {
@@ -124,7 +145,7 @@ static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
 static INLINE const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size,
                                             const MACROBLOCKD *xd,
                                             const struct tx_probs *tx_probs) {
-  return get_tx_probs(max_tx_size, vp9_get_tx_size_context(xd), tx_probs);
+  return get_tx_probs(max_tx_size, get_tx_size_context(xd), tx_probs);
 }
 
 static INLINE unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx,
index dcc4c62545eed984f3968a2b99307fb1d460ff5f..7ca5a253504fc76818f9323750d344d47537f28c 100644 (file)
@@ -66,7 +66,7 @@ static int read_segment_id(vp9_reader *r, const struct segmentation *seg) {
 static TX_SIZE read_selected_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd,
                                      TX_SIZE max_tx_size, vp9_reader *r) {
   FRAME_COUNTS *counts = xd->counts;
-  const int ctx = vp9_get_tx_size_context(xd);
+  const int ctx = get_tx_size_context(xd);
   const vp9_prob *tx_probs = get_tx_probs(max_tx_size, ctx, &cm->fc->tx_probs);
   int tx_size = vp9_read(r, tx_probs[0]);
   if (tx_size != TX_4X4 && max_tx_size >= TX_16X16) {
index dddf7df40788bbbced169a2db7e315985e729900..53908831f37d40733c6785f9727f25e8cc40c78a 100644 (file)
@@ -4217,7 +4217,7 @@ static void encode_superblock(VP9_COMP *cpi, ThreadData *td,
     if (cm->tx_mode == TX_MODE_SELECT &&
         mbmi->sb_type >= BLOCK_8X8  &&
         !(is_inter_block(mbmi) && (mbmi->skip || seg_skip))) {
-      ++get_tx_counts(max_txsize_lookup[bsize], vp9_get_tx_size_context(xd),
+      ++get_tx_counts(max_txsize_lookup[bsize], get_tx_size_context(xd),
                       &td->counts->tx)[mbmi->tx_size];
     } else {
       int x, y;