Avoid using multiplication in context fetch

Replace the multiplication with shifts.

Change-Id: I245efaddea2019d789179569e82e81bb7cb97715
diff --git a/av1/common/enums.h b/av1/common/enums.h
index 3d1b70f..7fa17e5 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -251,6 +251,7 @@
 #define MAX_TX_SQUARE (MAX_TX_SIZE * MAX_TX_SIZE)
 
 // Pad 4 extra columns to remove horizontal availability check.
+#define TX_PAD_HOR_LOG2 2
 #define TX_PAD_HOR 4
 // Pad 6 extra rows (2 on top and 4 on bottom) to remove vertical availability
 // check.
diff --git a/av1/common/txb_common.h b/av1/common/txb_common.h
index c0ceab2..59e0130 100644
--- a/av1/common/txb_common.h
+++ b/av1/common/txb_common.h
@@ -314,7 +314,6 @@
 static INLINE int get_nz_count_mag(const uint8_t *const levels, const int bwl,
                                    const int row, const int col,
                                    const TX_CLASS tx_class, int *const mag) {
-  const int stride = (1 << bwl) + TX_PAD_HOR;
   int count = 0;
   *mag = 0;
   for (int idx = 0; idx < SIG_REF_OFFSET_NUM; ++idx) {
@@ -330,7 +329,8 @@
                                             : sig_ref_offset_horiz[idx][1]));
     const int ref_row = row + row_offset;
     const int ref_col = col + col_offset;
-    const int nb_pos = ref_row * stride + ref_col;
+    const int nb_pos =
+        (ref_row << bwl) + (ref_row << TX_PAD_HOR_LOG2) + ref_col;
     const int level = levels[nb_pos];
     count += (level != 0);
 #if 1