Move fft4g to proper third_party directory

Bug: webrtc:8366
Change-Id: I98d3ae56a1d14b3ecacd85a4b3d234e215c8bc58
Reviewed-on: https://webrtc-review.googlesource.com/85642
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24103}
diff --git a/LICENSE_THIRD_PARTY b/LICENSE_THIRD_PARTY
index ee92c5c..adfb732 100644
--- a/LICENSE_THIRD_PARTY
+++ b/LICENSE_THIRD_PARTY
@@ -2,7 +2,6 @@
 party licenses. Paths to the files and associated licenses are collected here.
 
 Files governed by third party licenses:
-common_audio/fft4g.c
 common_audio/signal_processing/spl_sqrt_floor.c
 common_audio/signal_processing/spl_sqrt_floor_arm.S
 
@@ -41,15 +40,3 @@
  * Kevin
  */
 -------------------------------------------------------------------------------
-Files:
-common_audio/fft4g.c
-
-License:
-/*
- * http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
- * Copyright Takuya OOURA, 1996-2001
- *
- * You may use, copy, modify and distribute this code for any purpose (include
- * commercial use) and without fee. Please refer to this package when you modify
- * this code.
- */
diff --git a/common_audio/BUILD.gn b/common_audio/BUILD.gn
index 7b5de0c..6290360 100644
--- a/common_audio/BUILD.gn
+++ b/common_audio/BUILD.gn
@@ -52,7 +52,6 @@
 
   deps = [
     ":common_audio_c",
-    ":fft4g",
     ":sinc_resampler",
     "..:webrtc_common",
     "../rtc_base:checks",
@@ -63,6 +62,7 @@
     "../rtc_base/system:arch",
     "../system_wrappers",
     "../system_wrappers:cpu_features_api",
+    "third_party/fft4g:fft4g",
     "//third_party/abseil-cpp/absl/types:optional",
   ]
 
@@ -190,7 +190,6 @@
   deps = [
     ":common_audio_c_arm_asm",
     ":common_audio_cc",
-    ":fft4g",
     "..:webrtc_common",
     "../rtc_base:checks",
     "../rtc_base:compile_assert_c",
@@ -199,14 +198,7 @@
     "../rtc_base/system:arch",
     "../system_wrappers",
     "../system_wrappers:cpu_features_api",
-  ]
-}
-
-rtc_source_set("fft4g") {
-  visibility += webrtc_default_visibility
-  sources = [
-    "fft4g.c",
-    "fft4g.h",
+    "third_party/fft4g:fft4g",
   ]
 }
 
diff --git a/common_audio/real_fourier_ooura.cc b/common_audio/real_fourier_ooura.cc
index db65d26..89694c1 100644
--- a/common_audio/real_fourier_ooura.cc
+++ b/common_audio/real_fourier_ooura.cc
@@ -13,7 +13,7 @@
 #include <algorithm>
 #include <cmath>
 
-#include "common_audio/fft4g.h"
+#include "common_audio/third_party/fft4g/fft4g.h"
 #include "rtc_base/checks.h"
 
 namespace webrtc {
diff --git a/common_audio/third_party/fft4g/BUILD.gn b/common_audio/third_party/fft4g/BUILD.gn
new file mode 100644
index 0000000..4743c84
--- /dev/null
+++ b/common_audio/third_party/fft4g/BUILD.gn
@@ -0,0 +1,16 @@
+# Copyright (c) 2018 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("../../../webrtc.gni")
+
+rtc_source_set("fft4g") {
+  sources = [
+    "fft4g.c",
+    "fft4g.h",
+  ]
+}
diff --git a/common_audio/third_party/fft4g/LICENSE b/common_audio/third_party/fft4g/LICENSE
new file mode 100644
index 0000000..3bf870a
--- /dev/null
+++ b/common_audio/third_party/fft4g/LICENSE
@@ -0,0 +1,8 @@
+/*
+ * http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
+ * Copyright Takuya OOURA, 1996-2001
+ *
+ * You may use, copy, modify and distribute this code for any purpose (include
+ * commercial use) and without fee. Please refer to this package when you modify
+ * this code.
+ */
diff --git a/common_audio/third_party/fft4g/README.chromium b/common_audio/third_party/fft4g/README.chromium
new file mode 100644
index 0000000..9df2ddb
--- /dev/null
+++ b/common_audio/third_party/fft4g/README.chromium
@@ -0,0 +1,13 @@
+Name: General Purpose FFT (Fast Fourier/Cosine/Sine Transform) Package
+Short Name: fft4g
+URL: http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
+Version: 0
+Date: 2018-06-19
+License: Custome license
+License File: LICENSE
+Security Critical: yes
+
+Description:
+This is a package to calculate Discrete Fourier/Cosine/Sine Transforms of
+1-dimensional sequences of length 2^N. This package contains C and Fortran
+FFT codes.
diff --git a/common_audio/fft4g.c b/common_audio/third_party/fft4g/fft4g.c
similarity index 100%
rename from common_audio/fft4g.c
rename to common_audio/third_party/fft4g/fft4g.c
diff --git a/common_audio/fft4g.h b/common_audio/third_party/fft4g/fft4g.h
similarity index 100%
rename from common_audio/fft4g.h
rename to common_audio/third_party/fft4g/fft4g.h
diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn
index 3c257a0..6af2bc0 100644
--- a/modules/audio_processing/BUILD.gn
+++ b/modules/audio_processing/BUILD.gn
@@ -108,7 +108,7 @@
     "../../api/audio:echo_control",
     "../../audio/utility:audio_frame_operations",
     "../../common_audio:common_audio_c",
-    "../../common_audio:fft4g",
+    "../../common_audio/third_party/fft4g:fft4g",
     "../../rtc_base:checks",
     "../../rtc_base:deprecation",
     "../../rtc_base:gtest_prod",
@@ -260,7 +260,7 @@
     "../..:webrtc_common",
     "../../common_audio",
     "../../common_audio:common_audio_c",
-    "../../common_audio:fft4g",
+    "../../common_audio/third_party/fft4g:fft4g",
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base_approved",
     "../../system_wrappers:cpu_features_api",
diff --git a/modules/audio_processing/agc/BUILD.gn b/modules/audio_processing/agc/BUILD.gn
index 1ce3eae..18dbfb9 100644
--- a/modules/audio_processing/agc/BUILD.gn
+++ b/modules/audio_processing/agc/BUILD.gn
@@ -67,7 +67,7 @@
     "../../..:webrtc_common",
     "../../../common_audio",
     "../../../common_audio:common_audio_c",
-    "../../../common_audio:fft4g",
+    "../../../common_audio/third_party/fft4g",
     "../../../rtc_base:checks",
     "../../../rtc_base:rtc_base_approved",
     "../../../system_wrappers:cpu_features_api",
diff --git a/modules/audio_processing/ns/ns_core.c b/modules/audio_processing/ns/ns_core.c
index c87713a..bc5dd6d 100644
--- a/modules/audio_processing/ns/ns_core.c
+++ b/modules/audio_processing/ns/ns_core.c
@@ -13,8 +13,8 @@
 #include <stdlib.h>
 
 #include "rtc_base/checks.h"
-#include "common_audio/fft4g.h"
 #include "common_audio/signal_processing/include/signal_processing_library.h"
+#include "common_audio/third_party/fft4g/fft4g.h"
 #include "modules/audio_processing/ns/noise_suppression.h"
 #include "modules/audio_processing/ns/ns_core.h"
 #include "modules/audio_processing/ns/windows_private.h"
diff --git a/modules/audio_processing/transient/transient_suppressor.cc b/modules/audio_processing/transient/transient_suppressor.cc
index b62935a..1a5ed56 100644
--- a/modules/audio_processing/transient/transient_suppressor.cc
+++ b/modules/audio_processing/transient/transient_suppressor.cc
@@ -17,9 +17,9 @@
 #include <deque>
 #include <set>
 
-#include "common_audio/fft4g.h"
 #include "common_audio/include/audio_util.h"
 #include "common_audio/signal_processing/include/signal_processing_library.h"
+#include "common_audio/third_party/fft4g/fft4g.h"
 #include "modules/audio_processing/ns/windows_private.h"
 #include "modules/audio_processing/transient/common.h"
 #include "modules/audio_processing/transient/transient_detector.h"
diff --git a/modules/audio_processing/vad/BUILD.gn b/modules/audio_processing/vad/BUILD.gn
index 378fbb8..6c64e94 100644
--- a/modules/audio_processing/vad/BUILD.gn
+++ b/modules/audio_processing/vad/BUILD.gn
@@ -38,7 +38,7 @@
     "../../../audio/utility:audio_frame_operations",
     "../../../common_audio",
     "../../../common_audio:common_audio_c",
-    "../../../common_audio:fft4g",
+    "../../../common_audio/third_party/fft4g:fft4g",
     "../../../rtc_base:checks",
     "../../audio_coding:isac_vad",
   ]
diff --git a/modules/audio_processing/vad/vad_audio_proc.cc b/modules/audio_processing/vad/vad_audio_proc.cc
index e9007c6..53eb6de 100644
--- a/modules/audio_processing/vad/vad_audio_proc.cc
+++ b/modules/audio_processing/vad/vad_audio_proc.cc
@@ -14,7 +14,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "common_audio/fft4g.h"
+#include "common_audio/third_party/fft4g/fft4g.h"
 #include "modules/audio_processing/vad/pitch_internal.h"
 #include "modules/audio_processing/vad/pole_zero_filter.h"
 #include "modules/audio_processing/vad/vad_audio_proc_internal.h"
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
index a4f9cbf..5befb88 100755
--- a/tools_webrtc/libs/generate_licenses.py
+++ b/tools_webrtc/libs/generate_licenses.py
@@ -53,6 +53,7 @@
     'fft': ['modules/third_party/fft/LICENSE'],
     'g711': ['modules/third_party/g711/LICENSE'],
     'g722': ['modules/third_party/g722/LICENSE'],
+    'fft4g': ['common_audio/third_party/fft4g/LICENSE'],
 
     # Compile time dependencies, no license needed:
     'yasm': [],