]> granicus.if.org Git - libvpx/commitdiff
Making get_tx_counts() similar to get_tx_probs().
authorDmitry Kovalev <dkovalev@google.com>
Tue, 29 Oct 2013 02:52:38 +0000 (19:52 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 29 Oct 2013 02:52:38 +0000 (19:52 -0700)
Change-Id: I5b17f40e515c4bcf9ebef5380270a214af4e0115

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

index a869dc0a61f813aca7dd376a180430027ca2c5f1..19032bf628f2a8b4cd97016e99074838b25db26f 100644 (file)
@@ -127,14 +127,14 @@ static const vp9_prob *get_tx_probs2(const MACROBLOCKD *xd,
   return get_tx_probs(bsize, context, tx_probs);
 }
 
-static void update_tx_counts(BLOCK_SIZE bsize, uint8_t context,
-                             TX_SIZE tx_size, struct tx_counts *tx_counts) {
-  if (bsize >= BLOCK_32X32)
-    tx_counts->p32x32[context][tx_size]++;
-  else if (bsize >= BLOCK_16X16)
-    tx_counts->p16x16[context][tx_size]++;
+static unsigned int *get_tx_counts(BLOCK_SIZE bsize, uint8_t context,
+                                   struct tx_counts *tx_counts) {
+  if (bsize < BLOCK_16X16)
+    return tx_counts->p8x8[context];
+  else if (bsize < BLOCK_32X32)
+    return tx_counts->p16x16[context];
   else
-    tx_counts->p8x8[context][tx_size]++;
+    return tx_counts->p32x32[context];
 }
 
 #endif  // VP9_COMMON_VP9_PRED_COMMON_H_
index 6bc51e8946f98116e894d0d7ef16488a29d7f2eb..475a29977f932df3f035c7acff25b91e85d594f0 100644 (file)
@@ -72,7 +72,7 @@ static TX_SIZE read_selected_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd,
   }
 
   if (!cm->frame_parallel_decoding_mode)
-    update_tx_counts(bsize, context, tx_size, &cm->counts.tx);
+    ++get_tx_counts(bsize, context, &cm->counts.tx)[tx_size];
   return tx_size;
 }
 
index 5ff59a8c18283abb0debc54936507d88f155964d..9408e5473d46fe7a0950d7f3a15403e593c73f8f 100644 (file)
@@ -2493,7 +2493,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
             (mbmi->skip_coeff ||
              vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)))) {
       const uint8_t context = vp9_get_pred_context_tx_size(xd);
-      update_tx_counts(bsize, context, mbmi->tx_size, &cm->counts.tx);
+      ++get_tx_counts(bsize, context, &cm->counts.tx)[mbmi->tx_size];
     } else {
       int x, y;
       TX_SIZE sz = tx_mode_to_biggest_tx_size[cm->tx_mode];