Move fft to proper third_party directory

Bug: webrtc:8366
Change-Id: I741a381fe1cf18909baefd89743b2ff4fe0a6bae
Reviewed-on: https://webrtc-review.googlesource.com/86822
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24091}
diff --git a/LICENSE_THIRD_PARTY b/LICENSE_THIRD_PARTY
index 7838d57..080a6bf 100644
--- a/LICENSE_THIRD_PARTY
+++ b/LICENSE_THIRD_PARTY
@@ -110,36 +110,6 @@
  */
 -------------------------------------------------------------------------------
 Files:
-modules/audio_coding/codecs/isac/main/source/fft.c
-
-License:
-/*
- * Copyright(c)1995,97 Mark Olesen <olesen@me.QueensU.CA>
- *    Queen's Univ at Kingston (Canada)
- *
- * Permission to use, copy, modify, and distribute this software for
- * any purpose without fee is hereby granted, provided that this
- * entire notice is included in all copies of any software which is
- * or includes a copy or modification of this software and in all
- * copies of the supporting documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S
- * UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY
- * KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS
- * FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- * All of which is to say that you can do what you like with this
- * source code provided you don't try to sell it as your own and you
- * include an unaltered copy of this message (including the
- * copyright).
- *
- * It is also implicitly understood that bug fixes and improvements
- * should make their way back to the general Internet community so
- * that everyone benefits.
- */
--------------------------------------------------------------------------------
-Files:
 common_audio/fft4g.c
 
 License:
diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn
index 8cd7ab4..c7ed147 100644
--- a/modules/audio_coding/BUILD.gn
+++ b/modules/audio_coding/BUILD.gn
@@ -575,7 +575,6 @@
   }
 
   deps = [
-    ":fft",
     ":isac_bwinfo",
     ":isac_vad",
     "../..:typedefs",
@@ -585,17 +584,7 @@
     "../../rtc_base:checks",
     "../../rtc_base:compile_assert_c",
     "../../rtc_base:rtc_base_approved",
-  ]
-}
-
-rtc_source_set("fft") {
-  poisonous = [ "audio_codecs" ]
-  sources = [
-    "codecs/isac/main/source/fft.c",
-    "codecs/isac/main/source/fft.h",
-  ]
-  deps = [
-    ":isac_vad",
+    "../third_party/fft:fft",
   ]
 }
 
diff --git a/modules/audio_coding/codecs/isac/main/source/transform.c b/modules/audio_coding/codecs/isac/main/source/transform.c
index bfbfecb..082ad94 100644
--- a/modules/audio_coding/codecs/isac/main/source/transform.c
+++ b/modules/audio_coding/codecs/isac/main/source/transform.c
@@ -11,9 +11,9 @@
 #include <math.h>
 
 #include "modules/audio_coding/codecs/isac/main/source/settings.h"
-#include "modules/audio_coding/codecs/isac/main/source/fft.h"
 #include "modules/audio_coding/codecs/isac/main/source/codec.h"
 #include "modules/audio_coding/codecs/isac/main/source/os_specific_inline.h"
+#include "modules/third_party/fft/fft.h"
 
 void WebRtcIsac_InitTransform(TransformTables* tables) {
   int k;
diff --git a/modules/third_party/fft/BUILD.gn b/modules/third_party/fft/BUILD.gn
new file mode 100644
index 0000000..1a8e79b
--- /dev/null
+++ b/modules/third_party/fft/BUILD.gn
@@ -0,0 +1,20 @@
+# 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("fft") {
+  poisonous = [ "audio_codecs" ]
+  sources = [
+    "fft.c",
+    "fft.h",
+  ]
+  deps = [
+    "../../audio_coding:isac_vad",
+  ]
+}
diff --git a/modules/third_party/fft/LICENSE b/modules/third_party/fft/LICENSE
new file mode 100644
index 0000000..c0a7805
--- /dev/null
+++ b/modules/third_party/fft/LICENSE
@@ -0,0 +1,25 @@
+/*
+ * Copyright(c)1995,97 Mark Olesen <olesen@me.QueensU.CA>
+ *    Queen's Univ at Kingston (Canada)
+ *
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose without fee is hereby granted, provided that this
+ * entire notice is included in all copies of any software which is
+ * or includes a copy or modification of this software and in all
+ * copies of the supporting documentation for such software.
+ *
+ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S
+ * UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY
+ * KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS
+ * FITNESS FOR ANY PARTICULAR PURPOSE.
+ *
+ * All of which is to say that you can do what you like with this
+ * source code provided you don't try to sell it as your own and you
+ * include an unaltered copy of this message (including the
+ * copyright).
+ *
+ * It is also implicitly understood that bug fixes and improvements
+ * should make their way back to the general Internet community so
+ * that everyone benefits.
+ */
diff --git a/modules/third_party/fft/README.chromium b/modules/third_party/fft/README.chromium
new file mode 100644
index 0000000..a373b99
--- /dev/null
+++ b/modules/third_party/fft/README.chromium
@@ -0,0 +1,12 @@
+Name: fft
+Short Name: fft
+URL:
+Version: 0
+Date: 2018-02-01
+License: Custom license
+License File: LICENSE
+Security Critical: yes
+
+Description:
+Multivariate complex Fourier transform, computed in place
+using mixed-radix Fast Fourier Transform algorithm.
diff --git a/modules/audio_coding/codecs/isac/main/source/fft.c b/modules/third_party/fft/fft.c
similarity index 99%
rename from modules/audio_coding/codecs/isac/main/source/fft.c
rename to modules/third_party/fft/fft.c
index a3cbd5e..ffce99b 100644
--- a/modules/audio_coding/codecs/isac/main/source/fft.c
+++ b/modules/third_party/fft/fft.c
@@ -127,7 +127,7 @@
 #include <stdlib.h>
 #include <math.h>
 
-#include "modules/audio_coding/codecs/isac/main/source/fft.h"
+#include "modules/third_party/fft/fft.h"
 
 /* double precision routine */
 static int
@@ -211,7 +211,7 @@
     {
       max_factors = (int)nSpan;
     }
-    if ((int)nSpan > max_perm) 
+    if ((int)nSpan > max_perm)
     {
       max_perm = (int)nSpan;
     }
diff --git a/modules/audio_coding/codecs/isac/main/source/fft.h b/modules/third_party/fft/fft.h
similarity index 100%
rename from modules/audio_coding/codecs/isac/main/source/fft.h
rename to modules/third_party/fft/fft.h
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
index 66137f7..0281c40 100755
--- a/tools_webrtc/libs/generate_licenses.py
+++ b/tools_webrtc/libs/generate_licenses.py
@@ -49,6 +49,7 @@
     'zlib': ['third_party/zlib/LICENSE'],
     'base64': ['rtc_base/third_party/base64/LICENSE'],
     'portaudio': ['modules/third_party/portaudio/LICENSE'],
+    'fft': ['modules/third_party/fft/LICENSE'],
 
     # Compile time dependencies, no license needed:
     'yasm': [],