Add macros to turn off inter and intra mrc_dct separately
This will aid in testing different masking methods for inter
and intra blocks.
Change-Id: Ic038da77e55405e3303177e6cd260bd5e19311c1
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 317db9e..2e2474b 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -818,6 +818,11 @@
static INLINE int is_rect_tx(TX_SIZE tx_size) { return tx_size >= TX_SIZES; }
#endif // CONFIG_RECT_TX
+#if CONFIG_MRC_TX
+#define USE_MRC_INTRA 0
+#define USE_MRC_INTER 1
+#endif // CONFIG_MRC_TX
+
#if CONFIG_EXT_TX
#define ALLOW_INTRA_EXT_TX 1
@@ -906,8 +911,12 @@
if (use_reduced_set)
return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
#if CONFIG_MRC_TX
- if (tx_size == TX_32X32)
- return is_inter ? EXT_TX_SET_MRC_DCT_IDTX : EXT_TX_SET_MRC_DCT;
+ if (tx_size == TX_32X32) {
+ if (is_inter && USE_MRC_INTER)
+ return EXT_TX_SET_MRC_DCT_IDTX;
+ else if (!is_inter && USE_MRC_INTRA)
+ return EXT_TX_SET_MRC_DCT;
+ }
#endif // CONFIG_MRC_TX
if (tx_size_sqr_up == TX_32X32)
return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
@@ -1275,6 +1284,9 @@
#if CONFIG_EXT_TX
#if CONFIG_MRC_TX
if (mbmi->tx_type == MRC_DCT) {
+ assert(((is_inter_block(mbmi) && USE_MRC_INTER) ||
+ (!is_inter_block(mbmi) && USE_MRC_INTRA)) &&
+ "INVALID BLOCK TYPE FOR MRC_DCT");
if (plane_type == PLANE_TYPE_Y) {
assert(tx_size == TX_32X32);
return mbmi->tx_type;
diff --git a/av1/common/idct.c b/av1/common/idct.c
index 58cfc45..a6543a2 100644
--- a/av1/common/idct.c
+++ b/av1/common/idct.c
@@ -2237,6 +2237,7 @@
#if CONFIG_LGT || CONFIG_MRC_TX
txfm_param.dst = dst;
txfm_param.stride = stride;
+ txfm_param.is_inter = is_inter_block(&xd->mi[0]->mbmi);
#endif // CONFIG_LGT || CONFIG_MRC_TX
#if CONFIG_LGT
txfm_param.mode = mode;
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index d78ec96..b28340a 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -628,11 +628,11 @@
txfm_param.tx_size = tx_size;
txfm_param.lossless = xd->lossless[mbmi->segment_id];
#if CONFIG_MRC_TX || CONFIG_LGT
+ txfm_param.is_inter = is_inter_block(mbmi);
txfm_param.dst = dst;
txfm_param.stride = dst_stride;
#endif // CONFIG_MRC_TX || CONFIG_LGT
#if CONFIG_LGT
- txfm_param.is_inter = is_inter_block(mbmi);
txfm_param.mode = get_prediction_mode(xd->mi[0], plane, tx_size, block);
#endif
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 93c385d..a70259b 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -2451,7 +2451,10 @@
#if CONFIG_MRC_TX
// MRC_DCT only implemented for TX_32X32 so only include this tx in
// the search for TX_32X32
- if (tx_type == MRC_DCT && tx_size != TX_32X32) return 1;
+ if (tx_type == MRC_DCT &&
+ ((is_inter && !USE_MRC_INTER) || (!is_inter && !USE_MRC_INTRA) ||
+ tx_size != TX_32X32))
+ return 1;
#endif // CONFIG_MRC_TX
if (mbmi->ref_mv_idx > 0 && tx_type != DCT_DCT) return 1;
if (FIXED_TX_TYPE && tx_type != get_default_tx_type(0, xd, 0, tx_size))
@@ -5224,7 +5227,10 @@
#if CONFIG_MRC_TX
// MRC_DCT only implemented for TX_32X32 so only include this tx in
// the search for TX_32X32
- if (tx_type == MRC_DCT && max_tx_size != TX_32X32) continue;
+ if (tx_type == MRC_DCT &&
+ (max_tx_size != TX_32X32 || (is_inter && !USE_MRC_INTER) ||
+ (!is_inter && !USE_MRC_INTRA)))
+ continue;
#endif // CONFIG_MRC_TX
#if CONFIG_EXT_TX
if (is_inter) {