Revert of Reland "Move smoothing filter to common audio". (patchset #5 id:100001 of https://codereview.webrtc.org/2520003005/ )

Reason for revert:
Internal bots failed.

Original issue's description:
> Reland "Move smoothing filter to common audio".
>
> The original CL was this https://codereview.webrtc.org/2484153002/
>
> Due to failure with internal trial servers, it was reverted. This CL tries to reland it.
>
> BUG=webrtc:6443
>
> Committed: https://crrev.com/223641f1b903e41e77d88f03199b4cdb65255ec8
> Cr-Commit-Position: refs/heads/master@{#15227}

TBR=tommi@webrtc.org,solenberg@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2529943002
Cr-Commit-Position: refs/heads/master@{#15228}
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index 1fe2d7e..b3532b1 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -363,7 +363,6 @@
     testonly = true
     sources = [
       "api/fakemetricsobserver.cc",
-      "base/analytics/exp_filter_unittest.cc",
       "base/array_view_unittest.cc",
       "base/atomicops_unittest.cc",
       "base/autodetectproxy_unittest.cc",
@@ -381,6 +380,7 @@
       "base/criticalsection_unittest.cc",
       "base/event_tracer_unittest.cc",
       "base/event_unittest.cc",
+      "base/exp_filter_unittest.cc",
       "base/file_unittest.cc",
       "base/filerotatingstream_unittest.cc",
       "base/fileutils_unittest.cc",
@@ -511,7 +511,6 @@
       "base:rtc_base",
       "base:rtc_base_tests_utils",
       "base:rtc_task_queue",
-      "base/analytics:rtc_analytics",
       "p2p:libstunprober",
       "p2p:rtc_p2p",
       "//testing/gmock",
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 3708dc2..d1e6002 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -124,6 +124,8 @@
     "event.h",
     "event_tracer.cc",
     "event_tracer.h",
+    "exp_filter.cc",
+    "exp_filter.h",
     "file.cc",
     "file.h",
     "format_macros.h",
diff --git a/webrtc/base/analytics/BUILD.gn b/webrtc/base/analytics/BUILD.gn
deleted file mode 100644
index e7e631d..0000000
--- a/webrtc/base/analytics/BUILD.gn
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
-#
-# Use of this source code is governed by a BSD-style license
-# that can be found in the LICENSE file in the root of the source
-# tree. An additional intellectual property rights grant can be found
-# in the file PATENTS.  All contributing project authors may
-# be found in the AUTHORS file in the root of the source tree.
-
-import("../../build/webrtc.gni")
-
-rtc_static_library("rtc_analytics") {
-  sources = [
-    "exp_filter.cc",
-    "exp_filter.h",
-  ]
-}
diff --git a/webrtc/base/analytics/exp_filter.cc b/webrtc/base/exp_filter.cc
similarity index 95%
rename from webrtc/base/analytics/exp_filter.cc
rename to webrtc/base/exp_filter.cc
index 48fe1ad..9529480 100644
--- a/webrtc/base/analytics/exp_filter.cc
+++ b/webrtc/base/exp_filter.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "webrtc/base/analytics/exp_filter.h"
+#include "webrtc/base/exp_filter.h"
 
 #include <math.h>
 
diff --git a/webrtc/base/analytics/exp_filter.h b/webrtc/base/exp_filter.h
similarity index 90%
rename from webrtc/base/analytics/exp_filter.h
rename to webrtc/base/exp_filter.h
index e93de48..174159b 100644
--- a/webrtc/base/analytics/exp_filter.h
+++ b/webrtc/base/exp_filter.h
@@ -8,8 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef WEBRTC_BASE_ANALYTICS_EXP_FILTER_H_
-#define WEBRTC_BASE_ANALYTICS_EXP_FILTER_H_
+#ifndef WEBRTC_BASE_EXP_FILTER_H_
+#define WEBRTC_BASE_EXP_FILTER_H_
 
 namespace rtc {
 
@@ -46,4 +46,4 @@
 };
 }  // namespace rtc
 
-#endif  // WEBRTC_BASE_ANALYTICS_EXP_FILTER_H_
+#endif  // WEBRTC_BASE_EXP_FILTER_H_
diff --git a/webrtc/base/analytics/exp_filter_unittest.cc b/webrtc/base/exp_filter_unittest.cc
similarity index 95%
rename from webrtc/base/analytics/exp_filter_unittest.cc
rename to webrtc/base/exp_filter_unittest.cc
index 48cb4cc..f027808 100644
--- a/webrtc/base/analytics/exp_filter_unittest.cc
+++ b/webrtc/base/exp_filter_unittest.cc
@@ -10,8 +10,8 @@
 
 #include <math.h>
 
-#include "webrtc/base/analytics/exp_filter.h"
-#include "webrtc/test/gtest.h"
+#include "webrtc/base/gunit.h"
+#include "webrtc/base/exp_filter.h"
 
 namespace rtc {
 
diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn
index 84bee3d..bfed73e 100644
--- a/webrtc/common_audio/BUILD.gn
+++ b/webrtc/common_audio/BUILD.gn
@@ -86,8 +86,6 @@
     "signal_processing/splitting_filter.c",
     "signal_processing/sqrt_of_one_minus_x_squared.c",
     "signal_processing/vector_scaling_operations.c",
-    "smoothing_filter.cc",
-    "smoothing_filter.h",
     "sparse_fir_filter.cc",
     "sparse_fir_filter.h",
     "vad/include/vad.h",
@@ -111,7 +109,6 @@
   ]
 
   deps = [
-    "../base/analytics:rtc_analytics",
     "../system_wrappers",
   ]
 
@@ -260,7 +257,6 @@
       "ring_buffer_unittest.cc",
       "signal_processing/real_fft_unittest.cc",
       "signal_processing/signal_processing_unittest.cc",
-      "smoothing_filter_unittest.cc",
       "sparse_fir_filter_unittest.cc",
       "vad/vad_core_unittest.cc",
       "vad/vad_filterbank_unittest.cc",
diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn
index 7d7a4e4..5537829 100644
--- a/webrtc/modules/BUILD.gn
+++ b/webrtc/modules/BUILD.gn
@@ -264,6 +264,7 @@
       "audio_coding/audio_network_adaptor/frame_length_controller_unittest.cc",
       "audio_coding/audio_network_adaptor/mock/mock_controller.h",
       "audio_coding/audio_network_adaptor/mock/mock_controller_manager.h",
+      "audio_coding/audio_network_adaptor/smoothing_filter_unittest.cc",
     ]
     deps = [
       "audio_coding:audio_network_adaptor",
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 0dd4162..0e78abf 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -709,7 +709,6 @@
     ":audio_encoder_interface",
     ":audio_network_adaptor",
     "../../base:rtc_base_approved",
-    "../../base/analytics:rtc_analytics",
   ]
 
   defines = []
@@ -765,6 +764,8 @@
     "audio_network_adaptor/frame_length_controller.cc",
     "audio_network_adaptor/frame_length_controller.h",
     "audio_network_adaptor/include/audio_network_adaptor.h",
+    "audio_network_adaptor/smoothing_filter.cc",
+    "audio_network_adaptor/smoothing_filter.h",
   ]
 
   deps = [
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h
index 62a3533..0c2388b 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h
@@ -14,8 +14,8 @@
 #include <memory>
 
 #include "webrtc/base/constructormagic.h"
-#include "webrtc/common_audio/smoothing_filter.h"
 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
 
 namespace webrtc {
 
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc
index 823763f..9bbec26 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc
@@ -10,8 +10,8 @@
 
 #include <utility>
 
-#include "webrtc/common_audio/mocks/mock_smoothing_filter.h"
 #include "webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_smoothing_filter.h"
 #include "webrtc/test/gtest.h"
 
 namespace webrtc {
@@ -55,6 +55,7 @@
   std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
       new NiceMock<MockSmoothingFilter>());
   states.packet_loss_smoothed = mock_smoothing_filter.get();
+  EXPECT_CALL(*states.packet_loss_smoothed, Die());
   using Threshold = FecController::Config::Threshold;
   states.controller.reset(new FecController(
       FecController::Config(
@@ -261,6 +262,7 @@
   std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
       new NiceMock<MockSmoothingFilter>());
   states.packet_loss_smoothed = mock_smoothing_filter.get();
+  EXPECT_CALL(*states.packet_loss_smoothed, Die());
   using Threshold = FecController::Config::Threshold;
   states.controller.reset(new FecController(
       FecController::Config(
@@ -291,6 +293,7 @@
   std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
       new NiceMock<MockSmoothingFilter>());
   states.packet_loss_smoothed = mock_smoothing_filter.get();
+  EXPECT_CALL(*states.packet_loss_smoothed, Die());
   using Threshold = FecController::Config::Threshold;
   EXPECT_DEATH(
       states.controller.reset(new FecController(
diff --git a/webrtc/common_audio/mocks/mock_smoothing_filter.h b/webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_smoothing_filter.h
similarity index 60%
rename from webrtc/common_audio/mocks/mock_smoothing_filter.h
rename to webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_smoothing_filter.h
index 6b2991b..745ca98 100644
--- a/webrtc/common_audio/mocks/mock_smoothing_filter.h
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_smoothing_filter.h
@@ -8,20 +8,22 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef WEBRTC_COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
-#define WEBRTC_COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
+#ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_MOCK_MOCK_SMOOTHING_FILTER_H_
+#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_MOCK_MOCK_SMOOTHING_FILTER_H_
 
-#include "webrtc/common_audio/smoothing_filter.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
 #include "webrtc/test/gmock.h"
 
 namespace webrtc {
 
 class MockSmoothingFilter : public SmoothingFilter {
  public:
+  virtual ~MockSmoothingFilter() { Die(); }
+  MOCK_METHOD0(Die, void());
   MOCK_METHOD1(AddSample, void(float));
   MOCK_CONST_METHOD0(GetAverage, rtc::Optional<float>());
 };
 
 }  // namespace webrtc
 
-#endif  // WEBRTC_COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
+#endif  // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_MOCK_MOCK_SMOOTHING_FILTER_H_
diff --git a/webrtc/common_audio/smoothing_filter.cc b/webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.cc
similarity index 95%
rename from webrtc/common_audio/smoothing_filter.cc
rename to webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.cc
index 1cf9580..8a81069 100644
--- a/webrtc/common_audio/smoothing_filter.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.cc
@@ -10,7 +10,7 @@
 
 #include <cmath>
 
-#include "webrtc/common_audio/smoothing_filter.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
 
 namespace webrtc {
 
diff --git a/webrtc/common_audio/smoothing_filter.h b/webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h
similarity index 81%
rename from webrtc/common_audio/smoothing_filter.h
rename to webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h
index 64a83d1..c4de7b5 100644
--- a/webrtc/common_audio/smoothing_filter.h
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h
@@ -8,11 +8,11 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef WEBRTC_COMMON_AUDIO_SMOOTHING_FILTER_H_
-#define WEBRTC_COMMON_AUDIO_SMOOTHING_FILTER_H_
+#ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_SMOOTHING_FILTER_H_
+#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_SMOOTHING_FILTER_H_
 
-#include "webrtc/base/analytics/exp_filter.h"
 #include "webrtc/base/constructormagic.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/base/optional.h"
 #include "webrtc/system_wrappers/include/clock.h"
 
@@ -46,9 +46,9 @@
   int64_t last_sample_time_ms_;
   rtc::ExpFilter filter_;
 
-  RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SmoothingFilterImpl);
+  RTC_DISALLOW_COPY_AND_ASSIGN(SmoothingFilterImpl);
 };
 
 }  // namespace webrtc
 
-#endif  // WEBRTC_COMMON_AUDIO_SMOOTHING_FILTER_H_
+#endif  // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_SMOOTHING_FILTER_H_
diff --git a/webrtc/common_audio/smoothing_filter_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter_unittest.cc
similarity index 97%
rename from webrtc/common_audio/smoothing_filter_unittest.cc
rename to webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter_unittest.cc
index c80ffb6..af4e8d9 100644
--- a/webrtc/common_audio/smoothing_filter_unittest.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter_unittest.cc
@@ -10,7 +10,7 @@
 
 #include <memory>
 
-#include "webrtc/common_audio/smoothing_filter.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
 #include "webrtc/test/gtest.h"
 
 namespace webrtc {
diff --git a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
index e9772f6..0f0958c 100644
--- a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
+++ b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
@@ -13,8 +13,8 @@
 #include <algorithm>
 #include <iterator>
 
-#include "webrtc/base/analytics/exp_filter.h"
 #include "webrtc/base/checks.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/base/safe_conversions.h"
 #include "webrtc/common_types.h"
 #include "webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl.h"
diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
index b36b16d..2966c29 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
@@ -9,8 +9,8 @@
  */
 #include <memory>
 
+#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h"
-#include "webrtc/system_wrappers/include/clock.h"
 #include "webrtc/test/gtest.h"
 
 namespace webrtc {
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index cde07e1..8f413d9 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -93,7 +93,6 @@
     ":webrtc_vp8",
     ":webrtc_vp9",
     "../..:webrtc_common",
-    "../../base/analytics:rtc_analytics",
     "../../common_video",
     "../../system_wrappers",
   ]
@@ -125,7 +124,6 @@
   }
 
   deps = [
-    "../../base/analytics:rtc_analytics",
     "../../common_video",
     "../../system_wrappers",
   ]
diff --git a/webrtc/modules/video_coding/media_opt_util.h b/webrtc/modules/video_coding/media_opt_util.h
index bab1cbe..26f9332 100644
--- a/webrtc/modules/video_coding/media_opt_util.h
+++ b/webrtc/modules/video_coding/media_opt_util.h
@@ -16,7 +16,7 @@
 
 #include <memory>
 
-#include "webrtc/base/analytics/exp_filter.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/modules/video_coding/internal_defines.h"
 #include "webrtc/system_wrappers/include/trace.h"
 #include "webrtc/typedefs.h"
diff --git a/webrtc/modules/video_coding/utility/frame_dropper.h b/webrtc/modules/video_coding/utility/frame_dropper.h
index 468b417..20ff3d7 100644
--- a/webrtc/modules/video_coding/utility/frame_dropper.h
+++ b/webrtc/modules/video_coding/utility/frame_dropper.h
@@ -13,7 +13,7 @@
 
 #include <cstddef>
 
-#include "webrtc/base/analytics/exp_filter.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/typedefs.h"
 
 namespace webrtc {
diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn
index 2906cd8..9a75360 100644
--- a/webrtc/video/BUILD.gn
+++ b/webrtc/video/BUILD.gn
@@ -58,7 +58,6 @@
     "..:webrtc_common",
     "../base:rtc_base_approved",
     "../base:rtc_task_queue",
-    "../base/analytics:rtc_analytics",
     "../common_video",
     "../logging:rtc_event_log_api",
     "../modules/bitrate_controller",
diff --git a/webrtc/video/overuse_frame_detector.cc b/webrtc/video/overuse_frame_detector.cc
index 1670dc3..bb89864 100644
--- a/webrtc/video/overuse_frame_detector.cc
+++ b/webrtc/video/overuse_frame_detector.cc
@@ -17,8 +17,8 @@
 #include <list>
 #include <map>
 
-#include "webrtc/base/analytics/exp_filter.h"
 #include "webrtc/base/checks.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/common_video/include/frame_callback.h"
 #include "webrtc/system_wrappers/include/clock.h"
diff --git a/webrtc/video/overuse_frame_detector.h b/webrtc/video/overuse_frame_detector.h
index f1a99d7..3cd1fd5 100644
--- a/webrtc/video/overuse_frame_detector.h
+++ b/webrtc/video/overuse_frame_detector.h
@@ -14,9 +14,9 @@
 #include <list>
 #include <memory>
 
-#include "webrtc/base/analytics/exp_filter.h"
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/optional.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/base/sequenced_task_checker.h"
 #include "webrtc/base/task_queue.h"
 #include "webrtc/base/thread_annotations.h"
diff --git a/webrtc/video/send_statistics_proxy.h b/webrtc/video/send_statistics_proxy.h
index fff2d8d..ec2fe4c 100644
--- a/webrtc/video/send_statistics_proxy.h
+++ b/webrtc/video/send_statistics_proxy.h
@@ -16,8 +16,8 @@
 #include <string>
 #include <vector>
 
-#include "webrtc/base/analytics/exp_filter.h"
 #include "webrtc/base/criticalsection.h"
+#include "webrtc/base/exp_filter.h"
 #include "webrtc/base/ratetracker.h"
 #include "webrtc/base/thread_annotations.h"
 #include "webrtc/common_types.h"