Display moving object detection result on Nexus for debugging.

Review URL: https://codereview.webrtc.org/1890183003

Cr-Commit-Position: refs/heads/master@{#12390}
diff --git a/webrtc/modules/video_processing/util/noise_estimation.cc b/webrtc/modules/video_processing/util/noise_estimation.cc
index a0ae2c4..77ec965 100644
--- a/webrtc/modules/video_processing/util/noise_estimation.cc
+++ b/webrtc/modules/video_processing/util/noise_estimation.cc
@@ -9,6 +9,9 @@
  */
 
 #include "webrtc/modules/video_processing/util/noise_estimation.h"
+#if DISPLAY
+#include <android/log.h>
+#endif
 
 namespace webrtc {
 
@@ -50,7 +53,12 @@
           (0.65 * mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL) ||
       !num_noisy_block_) {
 #if DISPLAY
-    printf("Not enough samples. %d \n", num_static_block_);
+    if (cpu_type_) {
+      printf("Not enough samples. %d \n", num_static_block_);
+    } else {
+      __android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
+                          "Not enough samples. %d \n", num_static_block_);
+    }
 #endif
     noise_var_ = 0;
     noise_var_accum_ = 0;
@@ -59,9 +67,16 @@
     return;
   } else {
 #if DISPLAY
-    printf("%d %d fraction = %.3f\n", num_static_block_,
-           mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
-           percent_static_block_);
+    if (cpu_type_) {
+      printf("%d %d fraction = %.3f\n", num_static_block_,
+             mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
+             percent_static_block_);
+    } else {
+      __android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
+                          "%d %d fraction = %.3f\n", num_static_block_,
+                          mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
+                          percent_static_block_);
+    }
 #endif
     // Normalized by the number of noisy blocks.
     noise_var_ /= num_noisy_block_;
@@ -79,8 +94,14 @@
     noise_var_accum_ = (noise_var_accum_ * 15 + noise_var_) / 16;
   }
 #if DISPLAY
-  printf("noise_var_accum_ = %.1f, noise_var_ = %d.\n", noise_var_accum_,
-         noise_var_);
+  if (cpu_type_) {
+    printf("noise_var_accum_ = %.1f, noise_var_ = %d.\n", noise_var_accum_,
+           noise_var_);
+  } else {
+    __android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
+                        "noise_var_accum_ = %.1f, noise_var_ = %d.\n",
+                        noise_var_accum_, noise_var_);
+  }
 #endif
   // Reset noise_var_ for the next frame.
   noise_var_ = 0;
diff --git a/webrtc/modules/video_processing/video_denoiser.cc b/webrtc/modules/video_processing/video_denoiser.cc
index 4eef6d6..eafb5fa 100644
--- a/webrtc/modules/video_processing/video_denoiser.cc
+++ b/webrtc/modules/video_processing/video_denoiser.cc
@@ -12,6 +12,8 @@
 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
 #include "webrtc/modules/video_processing/video_denoiser.h"
 
+namespace webrtc {
+
 #if DISPLAY  // Rectangle diagnostics
 static void CopyMem8x8(const uint8_t* src,
                        int src_stride,
@@ -66,8 +68,6 @@
 }
 #endif
 
-namespace webrtc {
-
 VideoDenoiser::VideoDenoiser(bool runtime_cpu_detection)
     : width_(0),
       height_(0),