Re-enable ext-tile unit tests

This patch re-enabled the ext-tile unit tests that were disabled in
commit 40929b0bace910a672eae6de9a36b0b52e0de309.

The tests were adjusted according to ext-tile changes, and were ran
under AV1D_EXT_TILE_DEBUG=1.

Change-Id: I1b56d2c32b8cf0857b998075a28c2598d6720986
diff --git a/av1/decoder/obu.c b/av1/decoder/obu.c
index 482b641..a6b5131 100644
--- a/av1/decoder/obu.c
+++ b/av1/decoder/obu.c
@@ -710,7 +710,6 @@
   return AOM_CODEC_OK;
 }
 
-#define EXT_TILE_DEBUG 0
 // On success, returns a boolean that indicates whether the decoding of the
 // current frame is finished. On failure, sets cm->error.error_code and
 // returns -1.
@@ -816,7 +815,8 @@
           pbi->seen_frame_header = 1;
           frame_header_size = read_frame_header_obu(
               pbi, &rb, data, p_data_end, obu_header.type != OBU_FRAME);
-          if (cm->large_scale_tile) pbi->camera_frame_header_ready = 1;
+          if (!pbi->ext_tile_debug && cm->large_scale_tile)
+            pbi->camera_frame_header_ready = 1;
         }
         decoded_payload_size = frame_header_size;
         pbi->frame_header_size = (size_t)frame_header_size;
@@ -827,7 +827,6 @@
           break;
         }
 
-#if !EXT_TILE_DEBUG
         // In large scale tile coding, decode the common camera frame header
         // before any tile list OBU.
         if (!pbi->ext_tile_debug && pbi->camera_frame_header_ready) {
@@ -838,7 +837,6 @@
           *p_data_end = data_end;
           break;
         }
-#endif  // EXT_TILE_DEBUG
 
         if (obu_header.type != OBU_FRAME) break;
         obu_payload_offset = frame_header_size;
@@ -904,4 +902,3 @@
 
   return frame_decoding_finished;
 }
-#undef EXT_TILE_DEBUG
diff --git a/test/av1_ext_tile_test.cc b/test/av1_ext_tile_test.cc
index d2abbab..424d2f0 100644
--- a/test/av1_ext_tile_test.cc
+++ b/test/av1_ext_tile_test.cc
@@ -47,6 +47,7 @@
 
     decoder_ = codec_->CreateDecoder(cfg, 0);
     decoder_->Control(AV1_SET_TILE_MODE, 1);
+    decoder_->Control(AV1D_EXT_TILE_DEBUG, 1);
     decoder_->Control(AV1_SET_DECODE_TILE_ROW, -1);
     decoder_->Control(AV1_SET_DECODE_TILE_COL, -1);
 
@@ -82,13 +83,14 @@
       encoder->Control(AOME_SET_ENABLEAUTOALTREF, 0);
       encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
 
-      // The tile size is 64x64.
-      encoder->Control(AV1E_SET_TILE_COLUMNS, kTileSize);
-      encoder->Control(AV1E_SET_TILE_ROWS, kTileSize);
       // TODO(yunqingwang): test single_tile_decoding = 0.
       encoder->Control(AV1E_SET_SINGLE_TILE_DECODING, 1);
       // Always use 64x64 max partition.
       encoder->Control(AV1E_SET_SUPERBLOCK_SIZE, AOM_SUPERBLOCK_SIZE_64X64);
+      // Set tile_columns and tile_rows to MAX values, which guarantees the tile
+      // size of 64 x 64 pixels(i.e. 1 SB) for <= 4k resolution.
+      encoder->Control(AV1E_SET_TILE_COLUMNS, 6);
+      encoder->Control(AV1E_SET_TILE_ROWS, 6);
     }
 
     if (video->frame() == 1) {
@@ -195,7 +197,7 @@
   std::vector<std::string> tile_md5_;
 };
 
-TEST_P(AV1ExtTileTest, DISABLED_DecoderResultTest) { TestRoundTrip(); }
+TEST_P(AV1ExtTileTest, DecoderResultTest) { TestRoundTrip(); }
 
 AV1_INSTANTIATE_TEST_CASE(
     // Now only test 2-pass mode.
@@ -204,7 +206,7 @@
 
 class AV1ExtTileTestLarge : public AV1ExtTileTest {};
 
-TEST_P(AV1ExtTileTestLarge, DISABLED_DecoderResultTest) { TestRoundTrip(); }
+TEST_P(AV1ExtTileTestLarge, DecoderResultTest) { TestRoundTrip(); }
 
 AV1_INSTANTIATE_TEST_CASE(
     // Now only test 2-pass mode.
diff --git a/test/decode_multithreaded_test.cc b/test/decode_multithreaded_test.cc
index ed9a9ce..cde612d 100644
--- a/test/decode_multithreaded_test.cc
+++ b/test/decode_multithreaded_test.cc
@@ -48,11 +48,13 @@
     }
 
     if (single_thread_dec_->IsAV1()) {
+      single_thread_dec_->Control(AV1D_EXT_TILE_DEBUG, 1);
       single_thread_dec_->Control(AV1_SET_DECODE_TILE_ROW, -1);
       single_thread_dec_->Control(AV1_SET_DECODE_TILE_COL, -1);
     }
     for (int i = 0; i < kNumMultiThreadDecoders; ++i) {
       if (multi_thread_dec_[i]->IsAV1()) {
+        multi_thread_dec_[i]->Control(AV1D_EXT_TILE_DEBUG, 1);
         multi_thread_dec_[i]->Control(AV1_SET_DECODE_TILE_ROW, -1);
         multi_thread_dec_[i]->Control(AV1_SET_DECODE_TILE_COL, -1);
       }
@@ -163,7 +165,7 @@
 class AV1DecodeMultiThreadedLSTestLarge
     : public AV1DecodeMultiThreadedTestLarge {};
 
-TEST_P(AV1DecodeMultiThreadedLSTestLarge, DISABLED_MD5Match) {
+TEST_P(AV1DecodeMultiThreadedLSTestLarge, MD5Match) {
   cfg_.large_scale_tile = 1;
   single_thread_dec_->Control(AV1_SET_TILE_MODE, 1);
   for (int i = 0; i < kNumMultiThreadDecoders; ++i)
@@ -172,8 +174,7 @@
 }
 
 AV1_INSTANTIATE_TEST_CASE(AV1DecodeMultiThreadedLSTestLarge,
-                          ::testing::Values(1, 2, 32),
-                          ::testing::Values(1, 2, 32), ::testing::Values(1),
-                          ::testing::Values(0, 3));
+                          ::testing::Values(6), ::testing::Values(6),
+                          ::testing::Values(1), ::testing::Values(0, 3));
 
 }  // namespace
diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc
index b75d7be..3590843 100644
--- a/test/encode_test_driver.cc
+++ b/test/encode_test_driver.cc
@@ -217,6 +217,7 @@
       // Set dec_cfg.tile_row = -1 and dec_cfg.tile_col = -1 so that the whole
       // frame is decoded.
       decoder->Control(AV1_SET_TILE_MODE, cfg_.large_scale_tile);
+      decoder->Control(AV1D_EXT_TILE_DEBUG, 1);
       decoder->Control(AV1_SET_DECODE_TILE_ROW, -1);
       decoder->Control(AV1_SET_DECODE_TILE_COL, -1);
     }
diff --git a/test/ethread_test.cc b/test/ethread_test.cc
index 3dcc2a7..5e1880d 100644
--- a/test/ethread_test.cc
+++ b/test/ethread_test.cc
@@ -186,24 +186,24 @@
 
 class AVxEncoderThreadLSTest : public AVxEncoderThreadTest {
   virtual void SetTileSize(libaom_test::Encoder *encoder) {
-    encoder->Control(AV1E_SET_TILE_COLUMNS, 1);
-    // TODO(geza): Start using multiple tile rows when the multi-threaded
-    // encoder can handle them
-    encoder->Control(AV1E_SET_TILE_ROWS, 32);
+    encoder->Control(AV1E_SET_TILE_COLUMNS, 6);
+    encoder->Control(AV1E_SET_TILE_ROWS, 0);
   }
 };
 
-TEST_P(AVxEncoderThreadLSTest, DISABLED_EncoderResultTest) {
+TEST_P(AVxEncoderThreadLSTest, EncoderResultTest) {
   cfg_.large_scale_tile = 1;
   decoder_->Control(AV1_SET_TILE_MODE, 1);
+  decoder_->Control(AV1D_EXT_TILE_DEBUG, 1);
   DoTest();
 }
 
 class AVxEncoderThreadLSTestLarge : public AVxEncoderThreadLSTest {};
 
-TEST_P(AVxEncoderThreadLSTestLarge, DISABLED_EncoderResultTest) {
+TEST_P(AVxEncoderThreadLSTestLarge, EncoderResultTest) {
   cfg_.large_scale_tile = 1;
   decoder_->Control(AV1_SET_TILE_MODE, 1);
+  decoder_->Control(AV1D_EXT_TILE_DEBUG, 1);
   DoTest();
 }
 
diff --git a/test/tile_independence_test.cc b/test/tile_independence_test.cc
index e8b2e1f..cf534c0 100644
--- a/test/tile_independence_test.cc
+++ b/test/tile_independence_test.cc
@@ -146,25 +146,28 @@
 
 class TileIndependenceLSTest : public TileIndependenceTest {};
 
-TEST_P(TileIndependenceLSTest, DISABLED_MD5Match) {
+TEST_P(TileIndependenceLSTest, MD5Match) {
   cfg_.large_scale_tile = 1;
   fw_dec_->Control(AV1_SET_TILE_MODE, 1);
+  fw_dec_->Control(AV1D_EXT_TILE_DEBUG, 1);
   inv_dec_->Control(AV1_SET_TILE_MODE, 1);
+  inv_dec_->Control(AV1D_EXT_TILE_DEBUG, 1);
   DoTest();
 }
 
 class TileIndependenceLSTestLarge : public TileIndependenceTestLarge {};
 
-TEST_P(TileIndependenceLSTestLarge, DISABLED_MD5Match) {
+TEST_P(TileIndependenceLSTestLarge, MD5Match) {
   cfg_.large_scale_tile = 1;
   fw_dec_->Control(AV1_SET_TILE_MODE, 1);
+  fw_dec_->Control(AV1D_EXT_TILE_DEBUG, 1);
   inv_dec_->Control(AV1_SET_TILE_MODE, 1);
+  inv_dec_->Control(AV1D_EXT_TILE_DEBUG, 1);
   DoTest();
 }
 
-AV1_INSTANTIATE_TEST_CASE(TileIndependenceLSTest, ::testing::Values(1, 2, 32),
-                          ::testing::Values(1, 2, 32), ::testing::Values(1));
-AV1_INSTANTIATE_TEST_CASE(TileIndependenceLSTestLarge,
-                          ::testing::Values(1, 2, 32),
-                          ::testing::Values(1, 2, 32), ::testing::Values(1));
+AV1_INSTANTIATE_TEST_CASE(TileIndependenceLSTest, ::testing::Values(6),
+                          ::testing::Values(6), ::testing::Values(1));
+AV1_INSTANTIATE_TEST_CASE(TileIndependenceLSTestLarge, ::testing::Values(6),
+                          ::testing::Values(6), ::testing::Values(1));
 }  // namespace