rtc: Add test coverage for row_tiles

Adjust thresholds in rt_end_to_end tests,
in some case agressively to avoid further
issues later. And the test only encodes the
first 10 frames so psnr threshold can be
loosened a bit.

Change-Id: Icc1166e77fb3dee2634d231684393be9b7d7ad35
diff --git a/test/rt_end_to_end_test.cc b/test/rt_end_to_end_test.cc
index e8333a8..735d799 100644
--- a/test/rt_end_to_end_test.cc
+++ b/test/rt_end_to_end_test.cc
@@ -42,23 +42,23 @@
                          { { 5, { { 0, 36.2 }, { 3, 36.7 } } },
                            { 6, { { 0, 36.1 }, { 3, 36.48 } } },
                            { 7, { { 0, 35.5 }, { 3, 36.0 } } },
-                           { 8, { { 0, 35.8 }, { 3, 36.48 } } },
+                           { 8, { { 0, 35.8 }, { 3, 36.4 } } },
                            { 9, { { 0, 35.5 }, { 3, 36.0 } } },
                            { 10, { { 0, 35.3 }, { 3, 35.9 } } } } },
                        { "niklas_1280_720_30.y4m",
-                         { { 5, { { 0, 34.4 }, { 3, 34.30 } } },
-                           { 6, { { 0, 34.2 }, { 3, 34.2 } } },
-                           { 7, { { 0, 33.5 }, { 3, 33.48 } } },
-                           { 8, { { 0, 33.48 }, { 3, 33.48 } } },
-                           { 9, { { 0, 33.4 }, { 3, 33.4 } } },
-                           { 10, { { 0, 33.2 }, { 3, 33.2 } } } } },
+                         { { 5, { { 0, 34.4 }, { 3, 34.2 } } },
+                           { 6, { { 0, 34.1 }, { 3, 34.0 } } },
+                           { 7, { { 0, 33.5 }, { 3, 33.1 } } },
+                           { 8, { { 0, 33.3 }, { 3, 33.3 } } },
+                           { 9, { { 0, 33.3 }, { 3, 33.3 } } },
+                           { 10, { { 0, 33.1 }, { 3, 33.1 } } } } },
                        { "hantro_collage_w352h288_nv12.yuv",
-                         { { 5, { { 0, 34.4 }, { 3, 34.30 } } },
-                           { 6, { { 0, 34.2 }, { 3, 34.2 } } },
+                         { { 5, { { 0, 34.4 }, { 3, 34.2 } } },
+                           { 6, { { 0, 34.1 }, { 3, 34.1 } } },
                            { 7, { { 0, 33.6 }, { 3, 33.6 } } },
-                           { 8, { { 0, 33.48 }, { 3, 33.48 } } },
-                           { 9, { { 0, 33.4 }, { 3, 33.4 } } },
-                           { 10, { { 0, 33.2 }, { 3, 33.2 } } } } } };
+                           { 8, { { 0, 33.3 }, { 3, 33.3 } } },
+                           { 9, { { 0, 33.3 }, { 3, 33.3 } } },
+                           { 10, { { 0, 33.1 }, { 3, 33.1 } } } } } };
 
 typedef struct {
   const char *filename;
@@ -82,17 +82,17 @@
   { "hantro_collage_w352h288_nv12.yuv", 8, AOM_IMG_FMT_NV12, AOM_BITS_8, 0 },
 };
 
-// Params: test video, speed, aq mode, threads, tile columns.
+// Params: test video, speed, aq mode, threads, tile columns, tile rows.
 class RTEndToEndTest
-    : public ::libaom_test::CodecTestWith5Params<TestVideoParam, int,
-                                                 unsigned int, int, int>,
+    : public ::libaom_test::CodecTestWith6Params<TestVideoParam, int,
+                                                 unsigned int, int, int, int>,
       public ::libaom_test::EncoderTest {
  protected:
   RTEndToEndTest()
       : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(1)),
         cpu_used_(GET_PARAM(2)), psnr_(0.0), nframes_(0),
         aq_mode_(GET_PARAM(3)), threads_(GET_PARAM(4)),
-        tile_columns_(GET_PARAM(5)) {}
+        tile_columns_(GET_PARAM(5)), tile_rows_(GET_PARAM(6)) {}
 
   virtual ~RTEndToEndTest() {}
 
@@ -128,6 +128,7 @@
       encoder->Control(AV1E_SET_ENABLE_TPL_MODEL, 0);
       encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
       encoder->Control(AV1E_SET_TILE_COLUMNS, tile_columns_);
+      encoder->Control(AV1E_SET_TILE_ROWS, tile_rows_);
       encoder->Control(AOME_SET_CPUUSED, cpu_used_);
       encoder->Control(AV1E_SET_TUNE_CONTENT, AOM_CONTENT_DEFAULT);
       encoder->Control(AV1E_SET_AQ_MODE, aq_mode_);
@@ -183,6 +184,7 @@
   unsigned int aq_mode_;
   int threads_;
   int tile_columns_;
+  int tile_rows_;
 };
 
 class RTEndToEndTestThreaded : public RTEndToEndTest {};
@@ -194,11 +196,13 @@
 AV1_INSTANTIATE_TEST_SUITE(RTEndToEndTest, ::testing::ValuesIn(kTestVectors),
                            ::testing::Range(5, 12),
                            ::testing::Values<unsigned int>(0, 3),
-                           ::testing::Values(1), ::testing::Values(1));
+                           ::testing::Values(1), ::testing::Values(1),
+                           ::testing::Values(1));
 
 AV1_INSTANTIATE_TEST_SUITE(RTEndToEndTestThreaded,
                            ::testing::ValuesIn(kTestVectors),
                            ::testing::Range(5, 12),
                            ::testing::Values<unsigned int>(0, 3),
-                           ::testing::Range(2, 5), ::testing::Range(2, 5));
+                           ::testing::Range(2, 6), ::testing::Range(1, 5),
+                           ::testing::Range(1, 5));
 }  // namespace
diff --git a/test/svc_datarate_test.cc b/test/svc_datarate_test.cc
index 14c3b89..c50fdfc 100644
--- a/test/svc_datarate_test.cc
+++ b/test/svc_datarate_test.cc
@@ -116,7 +116,15 @@
       encoder->Control(AV1E_SET_ENABLE_TPL_MODEL, 0);
       encoder->Control(AV1E_SET_DELTAQ_MODE, 0);
       if (cfg_.g_threads > 1) {
-        encoder->Control(AV1E_SET_TILE_COLUMNS, cfg_.g_threads >> 1);
+        if (cfg_.g_threads == 4) {
+          encoder->Control(AV1E_SET_TILE_COLUMNS, 2);
+          encoder->Control(AV1E_SET_TILE_ROWS, 2);
+        } else if (cfg_.g_threads == 8) {
+          encoder->Control(AV1E_SET_TILE_COLUMNS, 4);
+          encoder->Control(AV1E_SET_TILE_ROWS, 2);
+        } else {
+          encoder->Control(AV1E_SET_TILE_COLUMNS, cfg_.g_threads >> 1);
+        }
         encoder->Control(AV1E_SET_ROW_MT, 1);
       }
       if (screen_mode_) {