aboutsummaryrefslogtreecommitdiff
path: root/common_audio
diff options
context:
space:
mode:
authorArtem Titov <titovartem@webrtc.org>2018-08-07 11:50:54 +0200
committerCommit Bot <commit-bot@chromium.org>2018-08-07 10:33:13 +0000
commit29835996e9a4204c9b597e3c2697325e47f1831e (patch)
tree64b58cbc35ac2839c1b9788dec0ed338f0105059 /common_audio
parent7008287219b6bc45465c409323bda75f4788a711 (diff)
downloadwebrtc-29835996e9a4204c9b597e3c2697325e47f1831e.tar.gz
Move spl_sqrt_floor dep to proper third_party directory
Bug: webrtc:8366 Change-Id: I326af5251dd88136dcc722e0ba1a2f9a8aebcf89 Reviewed-on: https://webrtc-review.googlesource.com/90405 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24205}
Diffstat (limited to 'common_audio')
-rw-r--r--common_audio/BUILD.gn8
-rw-r--r--common_audio/signal_processing/include/signal_processing_library.h21
-rw-r--r--common_audio/third_party/spl_sqrt_floor/BUILD.gn26
-rw-r--r--common_audio/third_party/spl_sqrt_floor/LICENSE27
-rw-r--r--common_audio/third_party/spl_sqrt_floor/README.chromium12
-rw-r--r--common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c (renamed from common_audio/signal_processing/spl_sqrt_floor.c)2
-rw-r--r--common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h29
-rw-r--r--common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S (renamed from common_audio/signal_processing/spl_sqrt_floor_arm.S)0
-rw-r--r--common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_mips.c (renamed from common_audio/signal_processing/spl_sqrt_floor_mips.c)2
9 files changed, 101 insertions, 26 deletions
diff --git a/common_audio/BUILD.gn b/common_audio/BUILD.gn
index d6e860ff68..50bd0f4022 100644
--- a/common_audio/BUILD.gn
+++ b/common_audio/BUILD.gn
@@ -94,10 +94,7 @@ rtc_source_set("common_audio_c_arm_asm") {
sources = []
deps = []
if (current_cpu == "arm") {
- sources += [
- "signal_processing/complex_bit_reverse_arm.S",
- "signal_processing/spl_sqrt_floor_arm.S",
- ]
+ sources += [ "signal_processing/complex_bit_reverse_arm.S" ]
if (arm_version >= 7) {
sources += [ "signal_processing/filter_ar_fast_q12_armv7.S" ]
@@ -170,7 +167,6 @@ rtc_source_set("common_audio_c") {
"signal_processing/include/spl_inl_mips.h",
"signal_processing/min_max_operations_mips.c",
"signal_processing/resample_by_2_mips.c",
- "signal_processing/spl_sqrt_floor_mips.c",
]
if (mips_dsp_rev > 0) {
sources += [ "signal_processing/vector_scaling_operations_mips.c" ]
@@ -183,7 +179,6 @@ rtc_source_set("common_audio_c") {
sources += [
"signal_processing/complex_bit_reverse.c",
"signal_processing/filter_ar_fast_q12.c",
- "signal_processing/spl_sqrt_floor.c",
]
}
@@ -199,6 +194,7 @@ rtc_source_set("common_audio_c") {
"../system_wrappers",
"../system_wrappers:cpu_features_api",
"third_party/fft4g:fft4g",
+ "third_party/spl_sqrt_floor",
]
}
diff --git a/common_audio/signal_processing/include/signal_processing_library.h b/common_audio/signal_processing/include/signal_processing_library.h
index 72aabe3883..33469d429b 100644
--- a/common_audio/signal_processing/include/signal_processing_library.h
+++ b/common_audio/signal_processing/include/signal_processing_library.h
@@ -96,6 +96,9 @@ extern "C" {
// inline functions:
#include "common_audio/signal_processing/include/spl_inl.h"
+// third party math functions
+#include "common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h"
+
// Initialize SPL. Currently it contains only function pointer initialization.
// If the underlying platform is known to be ARM-Neon (WEBRTC_HAS_NEON defined),
// the pointers will be assigned to code optimized for Neon; otherwise, generic
@@ -573,7 +576,6 @@ int16_t WebRtcSpl_RandUArray(int16_t* vector,
// Math functions
int32_t WebRtcSpl_Sqrt(int32_t value);
-int32_t WebRtcSpl_SqrtFloor(int32_t value);
// Divisions. Implementations collected in division_operations.c and
// descriptions at bottom of this file.
@@ -1335,23 +1337,6 @@ void WebRtcSpl_SynthesisQMF(const int16_t* low_band,
//
//
-// WebRtcSpl_SqrtFloor(...)
-//
-// Returns the square root of the input value |value|. The precision of this
-// function is rounding down integer precision, i.e., sqrt(8) gives 2 as answer.
-// If |value| is a negative number then 0 is returned.
-//
-// Algorithm:
-//
-// An iterative 4 cylce/bit routine
-//
-// Input:
-// - value : Value to calculate sqrt of
-//
-// Return value : Result of the sqrt calculation
-//
-
-//
// WebRtcSpl_DivU32U16(...)
//
// Divides a uint32_t |num| by a uint16_t |den|.
diff --git a/common_audio/third_party/spl_sqrt_floor/BUILD.gn b/common_audio/third_party/spl_sqrt_floor/BUILD.gn
new file mode 100644
index 0000000000..194899ebda
--- /dev/null
+++ b/common_audio/third_party/spl_sqrt_floor/BUILD.gn
@@ -0,0 +1,26 @@
+# 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("spl_sqrt_floor") {
+ visibility = [ "../..:common_audio_c" ]
+ sources = [
+ "spl_sqrt_floor.h",
+ ]
+ deps = []
+ if (current_cpu == "arm") {
+ sources += [ "spl_sqrt_floor_arm.S" ]
+
+ deps += [ "../../../rtc_base/system:asm_defines" ]
+ } else if (current_cpu == "mipsel") {
+ sources += [ "spl_sqrt_floor_mips.c" ]
+ } else {
+ sources += [ "spl_sqrt_floor.c" ]
+ }
+}
diff --git a/common_audio/third_party/spl_sqrt_floor/LICENSE b/common_audio/third_party/spl_sqrt_floor/LICENSE
new file mode 100644
index 0000000000..fdf17a2041
--- /dev/null
+++ b/common_audio/third_party/spl_sqrt_floor/LICENSE
@@ -0,0 +1,27 @@
+/*
+ * Written by Wilco Dijkstra, 1996. The following email exchange establishes the
+ * license.
+ *
+ * From: Wilco Dijkstra <Wilco.Dijkstra@ntlworld.com>
+ * Date: Fri, Jun 24, 2011 at 3:20 AM
+ * Subject: Re: sqrt routine
+ * To: Kevin Ma <kma@google.com>
+ * Hi Kevin,
+ * Thanks for asking. Those routines are public domain (originally posted to
+ * comp.sys.arm a long time ago), so you can use them freely for any purpose.
+ * Cheers,
+ * Wilco
+ *
+ * ----- Original Message -----
+ * From: "Kevin Ma" <kma@google.com>
+ * To: <Wilco.Dijkstra@ntlworld.com>
+ * Sent: Thursday, June 23, 2011 11:44 PM
+ * Subject: Fwd: sqrt routine
+ * Hi Wilco,
+ * I saw your sqrt routine from several web sites, including
+ * http://www.finesse.demon.co.uk/steven/sqrt.html.
+ * Just wonder if there's any copyright information with your Successive
+ * approximation routines, or if I can freely use it for any purpose.
+ * Thanks.
+ * Kevin
+ */
diff --git a/common_audio/third_party/spl_sqrt_floor/README.chromium b/common_audio/third_party/spl_sqrt_floor/README.chromium
new file mode 100644
index 0000000000..b226490e85
--- /dev/null
+++ b/common_audio/third_party/spl_sqrt_floor/README.chromium
@@ -0,0 +1,12 @@
+Name: sql sqrt floor
+Short Name: sql_sqrt_floor
+URL: http://www.pertinentdetail.org/sqrt
+Version: 0
+Date: 2018-03-22
+License: Custom license
+License File: LICENSE
+Security Critical: yes
+
+Description:
+Sqrt routine, originally was posted to the USENET group comp.sys.arm on
+20 Jun 1996.
diff --git a/common_audio/signal_processing/spl_sqrt_floor.c b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
index 714138696b..b478a41b96 100644
--- a/common_audio/signal_processing/spl_sqrt_floor.c
+++ b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
@@ -28,7 +28,7 @@
// Minor modifications in code style for WebRTC, 2012.
-#include "common_audio/signal_processing/include/signal_processing_library.h"
+#include "common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h"
/*
* Algorithm:
diff --git a/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h
new file mode 100644
index 0000000000..eaa58e30a4
--- /dev/null
+++ b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+#include <stdint.h>
+
+//
+// WebRtcSpl_SqrtFloor(...)
+//
+// Returns the square root of the input value |value|. The precision of this
+// function is rounding down integer precision, i.e., sqrt(8) gives 2 as answer.
+// If |value| is a negative number then 0 is returned.
+//
+// Algorithm:
+//
+// An iterative 4 cylce/bit routine
+//
+// Input:
+// - value : Value to calculate sqrt of
+//
+// Return value : Result of the sqrt calculation
+//
+int32_t WebRtcSpl_SqrtFloor(int32_t value);
diff --git a/common_audio/signal_processing/spl_sqrt_floor_arm.S b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S
index 228e68e6ca..228e68e6ca 100644
--- a/common_audio/signal_processing/spl_sqrt_floor_arm.S
+++ b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S
diff --git a/common_audio/signal_processing/spl_sqrt_floor_mips.c b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_mips.c
index 7128fbd381..04033c14de 100644
--- a/common_audio/signal_processing/spl_sqrt_floor_mips.c
+++ b/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_mips.c
@@ -29,7 +29,7 @@
// Minor modifications in code style for WebRTC, 2012.
// Code optimizations for MIPS, 2013.
-#include "common_audio/signal_processing/include/signal_processing_library.h"
+#include "common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h"
/*
* Algorithm: