Use different thresholds for ARM and x86 in libvpx tests
and audio processing tests.

Bug: webrtc:8757
Change-Id: Ic748fa624ac84af4556cb4b51718106a10fbb787
Reviewed-on: https://webrtc-review.googlesource.com/98540
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24698}
diff --git a/modules/audio_processing/audio_processing_unittest.cc b/modules/audio_processing/audio_processing_unittest.cc
index b96c3ec..a894817 100644
--- a/modules/audio_processing/audio_processing_unittest.cc
+++ b/modules/audio_processing/audio_processing_unittest.cc
@@ -2187,7 +2187,7 @@
       // TODO(bjornv): If we start getting more of these offsets on Android we
       // should consider a different approach. Either using one slack for all,
       // or generate a separate android reference.
-#if defined(WEBRTC_ANDROID)
+#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
       const int kHasVoiceCountOffset = 3;
       const int kHasVoiceCountNear = 8;
       const int kMaxOutputAverageOffset = 9;
diff --git a/modules/video_coding/codecs/test/videocodec_test_libvpx.cc b/modules/video_coding/codecs/test/videocodec_test_libvpx.cc
index 3bd0fe4..9586ce9 100644
--- a/modules/video_coding/codecs/test/videocodec_test_libvpx.cc
+++ b/modules/video_coding/codecs/test/videocodec_test_libvpx.cc
@@ -218,11 +218,11 @@
   std::vector<RateControlThresholds> rc_thresholds = {
       {5, 1, 0, 0.1, 0.2, 0.1, 0, 1}};
 
-  // std::vector<QualityThresholds> quality_thresholds = {{37, 35, 0.93, 0.91}};
-  // TODO(webrtc:8757): ARM VP8 encoder's quality is significantly worse
-  // than quality of x86 version. Use lower thresholds for now.
+#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
   std::vector<QualityThresholds> quality_thresholds = {{35, 33, 0.91, 0.89}};
-
+#else
+  std::vector<QualityThresholds> quality_thresholds = {{37, 35, 0.93, 0.91}};
+#endif
   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
 }
 
@@ -259,13 +259,13 @@
       {15.5, 1, 0, 0.1, 0.2, 0.1, 0, 0},
       {15, 1, 0, 0.3, 0.2, 0.1, 0, 0}};
 
-  // std::vector<QualityThresholds> quality_thresholds = {
-  //     {33, 32, 0.89, 0.88}, {38, 36, 0.94, 0.93}, {35, 34, 0.92, 0.91}};
-  // TODO(webrtc:8757): ARM VP8 encoder's quality is significantly worse
-  // than quality of x86 version. Use lower thresholds for now.
+#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
   std::vector<QualityThresholds> quality_thresholds = {
       {31.8, 31, 0.86, 0.85}, {36, 34.8, 0.92, 0.90}, {33.5, 32, 0.90, 0.88}};
-
+#else
+  std::vector<QualityThresholds> quality_thresholds = {
+      {33, 32, 0.89, 0.88}, {38, 36, 0.94, 0.93}, {35, 34, 0.92, 0.91}};
+#endif
   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
 }
 
@@ -288,24 +288,25 @@
       {80, 15, 200},
       {80, 10, kNumFramesLong}};
 
-  // std::vector<RateControlThresholds> rc_thresholds = {
-  //     {10, 2, 20, 0.4, 0.3, 0.1, 0, 1},
-  //     {5, 2, 5, 0.3, 0.3, 0.1, 0, 0},
-  //     {4, 2, 1, 0.2, 0.3, 0.2, 0, 0}};
-  // TODO(webrtc:8757): ARM VP8 drops more frames than x86 version. Use lower
-  // thresholds for now.
+#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
   std::vector<RateControlThresholds> rc_thresholds = {
       {10, 2, 60, 0.5, 0.3, 0.3, 0, 1},
       {10, 2, 30, 0.3, 0.3, 0.3, 0, 0},
       {10, 2, 10, 0.2, 0.3, 0.2, 0, 0}};
+#else
+  std::vector<RateControlThresholds> rc_thresholds = {
+      {10, 2, 20, 0.4, 0.3, 0.1, 0, 1},
+      {5, 2, 5, 0.3, 0.3, 0.1, 0, 0},
+      {4, 2, 1, 0.2, 0.3, 0.2, 0, 0}};
+#endif
 
-  // std::vector<QualityThresholds> quality_thresholds = {
-  //     {31, 30, 0.87, 0.86}, {32, 31, 0.89, 0.86}, {32, 30, 0.87, 0.82}};
-  // TODO(webrtc:8757): ARM VP8 encoder's quality is significantly worse
-  // than quality of x86 version. Use lower thresholds for now.
+#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
   std::vector<QualityThresholds> quality_thresholds = {
       {31, 30, 0.85, 0.84}, {31.5, 30.5, 0.86, 0.84}, {30.5, 29, 0.83, 0.78}};
-
+#else
+  std::vector<QualityThresholds> quality_thresholds = {
+      {31, 30, 0.87, 0.86}, {32, 31, 0.89, 0.86}, {32, 30, 0.87, 0.82}};
+#endif
   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
 }
 
@@ -325,21 +326,21 @@
   std::vector<RateProfile> rate_profiles = {{200, 30, 150},
                                             {400, 30, kNumFramesLong}};
 
-  // std::vector<RateControlThresholds> rc_thresholds = {
-  //     {5, 1, 0, 0.1, 0.2, 0.1, 0, 1}, {10, 2, 0, 0.1, 0.2, 0.1, 0, 1}};
-  // TODO(webrtc:8757): ARM VP8 drops more frames than x86 version. Use lower
-  // thresholds for now.
+#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
   std::vector<RateControlThresholds> rc_thresholds = {
       {10, 1, 2, 0.3, 0.2, 0.1, 0, 1}, {12, 2, 3, 0.1, 0.2, 0.1, 0, 1}};
-
-  // Min SSIM drops because of high motion scene with complex backgound (trees).
-  // std::vector<QualityThresholds> quality_thresholds = {{32, 30, 0.88, 0.85},
-  //                                                     {33, 30, 0.89, 0.83}};
-  // TODO(webrtc:8757): ARM VP8 encoder's quality is significantly worse
-  // than quality of x86 version. Use lower thresholds for now.
-  std::vector<QualityThresholds> quality_thresholds = {{31, 30, 0.85, 0.84},
+#else
+  std::vector<RateControlThresholds> rc_thresholds = {
+      {5, 1, 0, 0.1, 0.2, 0.1, 0, 1}, {10, 2, 0, 0.1, 0.2, 0.1, 0, 1}};
+#endif
+// Min SSIM drops because of high motion scene with complex backgound (trees).
+#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
+  std::vector<QualityThresholds> quality_thresholds = {{31, 30, 0.85, 0.83},
                                                        {31, 28, 0.85, 0.75}};
-
+#else
+  std::vector<QualityThresholds> quality_thresholds = {{32, 30, 0.88, 0.85},
+                                                       {33, 30, 0.89, 0.83}};
+#endif
   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
 }