Add CONFIG_DCT_ONLY experiment.

Building with --enable-dct_only will force the encoder to use only
 tx_type == DCT_DCT.
This experiment gives a loss and is only added for testing.

subset-1:

master@2017-02-21T01:23:58.825Z ->
 master-dct_only@2017-02-21T02:57:28.585Z

  PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
2.5467 |  1.0524 |  0.9171 |   1.8849 | 2.6626 |  2.4995 |     1.8402

objective-1-fast:

master@2017-02-21T01:47:43.790Z ->
 master-dct_only@2017-02-20T16:54:03.578Z

  PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
1.6625 |  0.3948 |  0.3368 |   1.5268 | 1.7142 |  1.7097 |     1.0743

Change-Id: I19b738f3d1a450bc50422149ac42bc184bfae08a
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 7444bc0..6bf892a 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -1052,7 +1052,11 @@
 #endif  // CONFIG_INTRA_INTERP
 #endif  // CONFIG_EXT_INTRA
 
+#if CONFIG_DCT_ONLY
+#define FIXED_TX_TYPE 1
+#else
 #define FIXED_TX_TYPE 0
+#endif
 
 // Converts block_index for given transform size to index of the block in raster
 // order.
@@ -1092,7 +1096,7 @@
                                           TX_SIZE tx_size) {
   const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
 
-  if (is_inter_block(mbmi) || plane_type != PLANE_TYPE_Y ||
+  if (CONFIG_DCT_ONLY || is_inter_block(mbmi) || plane_type != PLANE_TYPE_Y ||
       xd->lossless[mbmi->segment_id] || tx_size >= TX_32X32)
     return DCT_DCT;
 
@@ -1112,6 +1116,7 @@
 #endif  // CONFIG_INTRABC && (!CONFIG_EXT_TX || CONFIG_TXK_SEL)
 #if !CONFIG_TXK_SEL
 #if FIXED_TX_TYPE
+  (void)mbmi;
   const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block);
   return get_default_tx_type(plane_type, xd, block_raster_idx, tx_size);
 #elif CONFIG_EXT_TX
diff --git a/av1/common/idct.c b/av1/common/idct.c
index e56631b..8f4e58a 100644
--- a/av1/common/idct.c
+++ b/av1/common/idct.c
@@ -276,6 +276,10 @@
   tran_low_t *outp = &out[0][0];
   int outstride = 4;
 
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
+
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[4];
   const tran_high_t *lgtmtx_row[4];
@@ -328,6 +332,9 @@
 void av1_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                          const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_4x8[] = {
     { aom_idct8_c, aom_idct4_c },    // DCT_DCT
     { aom_iadst8_c, aom_idct4_c },   // ADST_DCT
@@ -403,6 +410,9 @@
 void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                          const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_8x4[] = {
     { aom_idct4_c, aom_idct8_c },    // DCT_DCT
     { aom_iadst4_c, aom_idct8_c },   // ADST_DCT
@@ -479,6 +489,9 @@
 void av1_iht4x16_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                           const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_4x16[] = {
     { aom_idct16_c, aom_idct4_c },    // DCT_DCT
     { aom_iadst16_c, aom_idct4_c },   // ADST_DCT
@@ -546,6 +559,9 @@
 void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                           const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_16x4[] = {
     { aom_idct4_c, aom_idct16_c },    // DCT_DCT
     { aom_iadst4_c, aom_idct16_c },   // ADST_DCT
@@ -614,6 +630,9 @@
 void av1_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                            const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_8x16[] = {
     { aom_idct16_c, aom_idct8_c },    // DCT_DCT
     { aom_iadst16_c, aom_idct8_c },   // ADST_DCT
@@ -682,6 +701,9 @@
 void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                            const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_16x8[] = {
     { aom_idct8_c, aom_idct16_c },    // DCT_DCT
     { aom_iadst8_c, aom_idct16_c },   // ADST_DCT
@@ -751,6 +773,9 @@
 void av1_iht8x32_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                            const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_8x32[] = {
     { aom_idct32_c, aom_idct8_c },     // DCT_DCT
     { ihalfright32_c, aom_idct8_c },   // ADST_DCT
@@ -818,6 +843,9 @@
 void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                            const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_32x8[] = {
     { aom_idct8_c, aom_idct32_c },     // DCT_DCT
     { aom_iadst8_c, aom_idct32_c },    // ADST_DCT
@@ -886,6 +914,9 @@
 void av1_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                             const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_16x32[] = {
     { aom_idct32_c, aom_idct16_c },     // DCT_DCT
     { ihalfright32_c, aom_idct16_c },   // ADST_DCT
@@ -942,6 +973,9 @@
 void av1_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                             const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_32x16[] = {
     { aom_idct16_c, aom_idct32_c },     // DCT_DCT
     { aom_iadst16_c, aom_idct32_c },    // ADST_DCT
@@ -998,6 +1032,9 @@
 void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                          const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_8[] = {
     { aom_idct8_c, aom_idct8_c },    // DCT_DCT  = 0
     { aom_iadst8_c, aom_idct8_c },   // ADST_DCT = 1
@@ -1077,6 +1114,9 @@
 void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                             const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_16[] = {
     { aom_idct16_c, aom_idct16_c },    // DCT_DCT  = 0
     { aom_iadst16_c, aom_idct16_c },   // ADST_DCT = 1
@@ -1138,6 +1178,9 @@
 void av1_iht32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                              const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_32[] = {
     { aom_idct32_c, aom_idct32_c },      // DCT_DCT
     { ihalfright32_c, aom_idct32_c },    // ADST_DCT
@@ -1196,6 +1239,9 @@
 void av1_iht64x64_4096_add_c(const tran_low_t *input, uint8_t *dest, int stride,
                              const INV_TXFM_PARAM *param) {
   int tx_type = param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d IHT_64[] = {
     { idct64_col_c, idct64_row_c },      // DCT_DCT
     { ihalfright64_c, idct64_row_c },    // ADST_DCT
diff --git a/av1/encoder/dct.c b/av1/encoder/dct.c
index 9f90714..198c76d 100644
--- a/av1/encoder/dct.c
+++ b/av1/encoder/dct.c
@@ -1196,6 +1196,9 @@
 void av1_fht4x4_c(const int16_t *input, tran_low_t *output, int stride,
                   FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   if (tx_type == DCT_DCT) {
     aom_fdct4x4_c(input, output, stride);
   } else {
@@ -1268,6 +1271,9 @@
 void av1_fht4x8_c(const int16_t *input, tran_low_t *output, int stride,
                   FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct8, fdct4 },    // DCT_DCT
     { fadst8, fdct4 },   // ADST_DCT
@@ -1338,6 +1344,9 @@
 void av1_fht8x4_c(const int16_t *input, tran_low_t *output, int stride,
                   FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct4, fdct8 },    // DCT_DCT
     { fadst4, fdct8 },   // ADST_DCT
@@ -1408,6 +1417,9 @@
 void av1_fht4x16_c(const int16_t *input, tran_low_t *output, int stride,
                    FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct16, fdct4 },    // DCT_DCT
     { fadst16, fdct4 },   // ADST_DCT
@@ -1469,6 +1481,9 @@
 void av1_fht16x4_c(const int16_t *input, tran_low_t *output, int stride,
                    FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct4, fdct16 },    // DCT_DCT
     { fadst4, fdct16 },   // ADST_DCT
@@ -1530,6 +1545,9 @@
 void av1_fht8x16_c(const int16_t *input, tran_low_t *output, int stride,
                    FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct16, fdct8 },    // DCT_DCT
     { fadst16, fdct8 },   // ADST_DCT
@@ -1593,6 +1611,9 @@
 void av1_fht16x8_c(const int16_t *input, tran_low_t *output, int stride,
                    FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct8, fdct16 },    // DCT_DCT
     { fadst8, fdct16 },   // ADST_DCT
@@ -1656,6 +1677,9 @@
 void av1_fht8x32_c(const int16_t *input, tran_low_t *output, int stride,
                    FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct32, fdct8 },         // DCT_DCT
     { fhalfright32, fdct8 },   // ADST_DCT
@@ -1717,6 +1741,9 @@
 void av1_fht32x8_c(const int16_t *input, tran_low_t *output, int stride,
                    FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct8, fdct32 },         // DCT_DCT
     { fadst8, fdct32 },        // ADST_DCT
@@ -1778,6 +1805,9 @@
 void av1_fht16x32_c(const int16_t *input, tran_low_t *output, int stride,
                     FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct32, fdct16 },         // DCT_DCT
     { fhalfright32, fdct16 },   // ADST_DCT
@@ -1831,6 +1861,9 @@
 void av1_fht32x16_c(const int16_t *input, tran_low_t *output, int stride,
                     FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct16, fdct32 },         // DCT_DCT
     { fadst16, fdct32 },        // ADST_DCT
@@ -2009,6 +2042,9 @@
 void av1_fht8x8_c(const int16_t *input, tran_low_t *output, int stride,
                   FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   if (tx_type == DCT_DCT) {
     aom_fdct8x8_c(input, output, stride);
   } else {
@@ -2135,6 +2171,9 @@
 void av1_fht16x16_c(const int16_t *input, tran_low_t *output, int stride,
                     FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct16, fdct16 },    // DCT_DCT
     { fadst16, fdct16 },   // ADST_DCT
@@ -2189,6 +2228,9 @@
 void av1_fht32x32_c(const int16_t *input, tran_low_t *output, int stride,
                     FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct32, fdct32 },  // DCT_DCT
 #if CONFIG_EXT_TX
@@ -2278,6 +2320,9 @@
 void av1_fht64x64_c(const int16_t *input, tran_low_t *output, int stride,
                     FWD_TXFM_PARAM *fwd_txfm_param) {
   int tx_type = fwd_txfm_param->tx_type;
+#if CONFIG_DCT_ONLY
+  assert(tx_type == DCT_DCT);
+#endif
   static const transform_2d FHT[] = {
     { fdct64_col, fdct64_row },  // DCT_DCT
 #if CONFIG_EXT_TX
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 24a65d5..5f3d2ef 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -170,3 +170,4 @@
 set(CONFIG_BGSPRITE 0 CACHE NUMBER "Internal flag.")
 set(CONFIG_VAR_TX_NO_TX_MODE 0 CACHE NUMBER "Internal flag.")
 set(CONFIG_ANALYZER 0 CACHE NUMBER "Internal flag.")
+set(CONFIG_DCT_ONLY 0 CACHE NUMBER "Internal flag.")
diff --git a/configure b/configure
index 0077ce9..01869ea 100755
--- a/configure
+++ b/configure
@@ -290,6 +290,7 @@
     pvq
     cfl
     xiphrc
+    dct_only
     cb4x4
     chroma_2x2
     chroma_sub8x8