mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Reland "Unify OOURA implementations in one directory."
This is a reland of 09b439c6f7
Original change's description:
> Unify OOURA implementations in one directory.
>
> This CL moves the two OOURA implementations present in the WebRTC tree
> in one place.
>
> No functional change is expected.
>
> TBR=kwiberg@webrtc.org
>
> No-Try: True
> Bug: webrtc:11509
> Change-Id: I330a9ec57e3dc65c9c8b43edd4bb295c55920efa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173682
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31106}
TBR=kwiberg@webrtc.org, peah@webrtc.org
No-Tree-Checks: True
No-Try: True
Bug: webrtc:11509
Change-Id: Ifc28b0380062ab5aad5c498700aa3cc7f9c7802c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173720
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31111}
This commit is contained in:
parent
dc4f75f7ee
commit
f0d64a5f9b
31 changed files with 89 additions and 78 deletions
|
@ -55,7 +55,7 @@ rtc_library("common_audio") {
|
|||
"../rtc_base/system:file_wrapper",
|
||||
"../system_wrappers",
|
||||
"../system_wrappers:cpu_features_api",
|
||||
"third_party/fft4g",
|
||||
"third_party/ooura/fft_size_256:fft4g",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
|
@ -185,7 +185,7 @@ rtc_library("common_audio_c") {
|
|||
"../rtc_base/system:arch",
|
||||
"../system_wrappers",
|
||||
"../system_wrappers:cpu_features_api",
|
||||
"third_party/fft4g",
|
||||
"third_party/ooura/fft_size_256:fft4g",
|
||||
"third_party/spl_sqrt_floor",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include "common_audio/third_party/fft4g/fft4g.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_256/fft4g.h"
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -35,7 +35,7 @@ class RealFourierOoura : public RealFourier {
|
|||
const size_t length_;
|
||||
const size_t complex_length_;
|
||||
// These are work arrays for Ooura. The names are based on the comments in
|
||||
// fft4g.c.
|
||||
// common_audio/third_party/ooura/fft_size_256/fft4g.cc.
|
||||
const std::unique_ptr<size_t[]> work_ip_;
|
||||
const std::unique_ptr<float[]> work_w_;
|
||||
};
|
||||
|
|
51
common_audio/third_party/ooura/fft_size_128/BUILD.gn
vendored
Normal file
51
common_audio/third_party/ooura/fft_size_128/BUILD.gn
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Copyright (c) 2020 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_library("ooura_fft") {
|
||||
sources = [
|
||||
"ooura_fft.cc",
|
||||
"ooura_fft.h",
|
||||
"ooura_fft_tables_common.h",
|
||||
]
|
||||
deps = [
|
||||
"../../../../rtc_base/system:arch",
|
||||
"../../../../system_wrappers:cpu_features_api",
|
||||
]
|
||||
cflags = []
|
||||
|
||||
if (current_cpu == "x86" || current_cpu == "x64") {
|
||||
sources += [
|
||||
"ooura_fft_sse2.cc",
|
||||
"ooura_fft_tables_neon_sse2.h",
|
||||
]
|
||||
if (is_posix || is_fuchsia) {
|
||||
cflags += [ "-msse2" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_build_with_neon) {
|
||||
sources += [
|
||||
"ooura_fft_neon.cc",
|
||||
"ooura_fft_tables_neon_sse2.h",
|
||||
]
|
||||
|
||||
deps += [ "../../../../common_audio" ]
|
||||
|
||||
if (current_cpu != "arm64") {
|
||||
# Enable compilation for the NEON instruction set.
|
||||
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
|
||||
cflags += [ "-mfpu=neon" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (current_cpu == "mipsel" && mips_float_abi == "hard") {
|
||||
sources += [ "ooura_fft_mips.cc" ]
|
||||
}
|
||||
}
|
|
@ -21,9 +21,9 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_common.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
#include "system_wrappers/include/cpu_features_wrapper.h"
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_common.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
#include <arm_neon.h>
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_common.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_neon_sse2.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_neon_sse2.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
@ -11,9 +11,9 @@
|
|||
#include <emmintrin.h>
|
||||
#include <xmmintrin.h>
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_common.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_neon_sse2.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_neon_sse2.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
|
||||
namespace webrtc {
|
|
@ -11,7 +11,7 @@
|
|||
#ifndef MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_COMMON_H_
|
||||
#define MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_COMMON_H_
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
#ifndef MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_NEON_SSE2_H_
|
||||
#define MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_NEON_SSE2_H_
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
|
||||
#ifdef _MSC_VER /* visual c++ */
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||
# Copyright (c) 2020 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
|
||||
|
@ -6,7 +6,7 @@
|
|||
# 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")
|
||||
import("../../../../webrtc.gni")
|
||||
|
||||
rtc_library("fft4g") {
|
||||
sources = [
|
|
@ -289,6 +289,8 @@ Appendix :
|
|||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "common_audio/third_party/ooura/fft_size_256/fft4g.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace {
|
|
@ -8,8 +8,8 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef COMMON_AUDIO_THIRD_PARTY_FFT4G_FFT4G_H_
|
||||
#define COMMON_AUDIO_THIRD_PARTY_FFT4G_FFT4G_H_
|
||||
#ifndef COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
||||
#define COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -18,4 +18,4 @@ void WebRtc_rdft(size_t n, int isgn, float* a, size_t* ip, float* w);
|
|||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif /* COMMON_AUDIO_THIRD_PARTY_FFT4G_FFT4G_H_ */
|
||||
#endif // COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_
|
|
@ -164,7 +164,7 @@ rtc_library("audio_processing") {
|
|||
"../../api/audio:echo_control",
|
||||
"../../audio/utility:audio_frame_operations",
|
||||
"../../common_audio:common_audio_c",
|
||||
"../../common_audio/third_party/fft4g",
|
||||
"../../common_audio/third_party/ooura/fft_size_256:fft4g",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:deprecation",
|
||||
"../../rtc_base:gtest_prod",
|
||||
|
|
|
@ -140,6 +140,7 @@ rtc_library("aec3") {
|
|||
"../../../api/audio:aec3_config",
|
||||
"../../../api/audio:echo_control",
|
||||
"../../../common_audio:common_audio_c",
|
||||
"../../../common_audio/third_party/ooura/fft_size_128:ooura_fft",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
|
@ -149,7 +150,6 @@ rtc_library("aec3") {
|
|||
"../../../system_wrappers:field_trial",
|
||||
"../../../system_wrappers:metrics",
|
||||
"../utility:cascaded_biquad_filter",
|
||||
"../utility:ooura_fft",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#include <array>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "modules/audio_processing/aec3/aec3_common.h"
|
||||
#include "modules/audio_processing/aec3/fft_data.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "modules/audio_processing/aec3/aec3_common.h"
|
||||
#include "modules/audio_processing/aec3/aec3_fft.h"
|
||||
#include "modules/audio_processing/aec3/fft_data.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -75,7 +75,7 @@ rtc_library("legacy_agc") {
|
|||
deps = [
|
||||
"../../../common_audio",
|
||||
"../../../common_audio:common_audio_c",
|
||||
"../../../common_audio/third_party/fft4g",
|
||||
"../../../common_audio/third_party/ooura/fft_size_256:fft4g",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../system_wrappers:cpu_features_api",
|
||||
|
|
|
@ -150,9 +150,9 @@ rtc_library("noise_level_estimator") {
|
|||
"..:audio_frame_view",
|
||||
"../../../api:array_view",
|
||||
"../../../common_audio",
|
||||
"../../../common_audio/third_party/ooura/fft_size_128:ooura_fft",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:macromagic",
|
||||
"../utility:ooura_fft",
|
||||
]
|
||||
|
||||
configs += [ "..:apm_debug_dump" ]
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
|
||||
#include "modules/audio_processing/agc2/down_sampler.h"
|
||||
#include "modules/audio_processing/agc2/noise_spectrum_estimator.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -54,7 +54,8 @@ rtc_static_library("ns") {
|
|||
"..:high_pass_filter",
|
||||
"../../../api:array_view",
|
||||
"../../../common_audio:common_audio_c",
|
||||
"../../../common_audio/third_party/fft4g",
|
||||
"../../../common_audio/third_party/ooura/fft_size_128:ooura_fft",
|
||||
"../../../common_audio/third_party/ooura/fft_size_256:fft4g",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
|
@ -63,7 +64,6 @@ rtc_static_library("ns") {
|
|||
"../../../system_wrappers:field_trial",
|
||||
"../../../system_wrappers:metrics",
|
||||
"../utility:cascaded_biquad_filter",
|
||||
"../utility:ooura_fft",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "modules/audio_processing/ns/ns_fft.h"
|
||||
|
||||
#include "common_audio/third_party/fft4g/fft4g.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_256/fft4g.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ rtc_library("transient_suppressor_impl") {
|
|||
"../../../common_audio:common_audio_c",
|
||||
"../../../common_audio:fir_filter",
|
||||
"../../../common_audio:fir_filter_factory",
|
||||
"../../../common_audio/third_party/fft4g",
|
||||
"../../../common_audio/third_party/ooura/fft_size_256:fft4g",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:gtest_prod",
|
||||
"../../../rtc_base:logging",
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#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 "common_audio/third_party/ooura/fft_size_256/fft4g.h"
|
||||
#include "modules/audio_processing/transient/common.h"
|
||||
#include "modules/audio_processing/transient/transient_detector.h"
|
||||
#include "modules/audio_processing/transient/transient_suppressor.h"
|
||||
|
|
|
@ -30,48 +30,6 @@ rtc_library("legacy_delay_estimator") {
|
|||
deps = [ "../../../rtc_base:checks" ]
|
||||
}
|
||||
|
||||
rtc_library("ooura_fft") {
|
||||
sources = [
|
||||
"ooura_fft.cc",
|
||||
"ooura_fft.h",
|
||||
"ooura_fft_tables_common.h",
|
||||
]
|
||||
deps = [
|
||||
"../../../rtc_base/system:arch",
|
||||
"../../../system_wrappers:cpu_features_api",
|
||||
]
|
||||
cflags = []
|
||||
|
||||
if (current_cpu == "x86" || current_cpu == "x64") {
|
||||
sources += [
|
||||
"ooura_fft_sse2.cc",
|
||||
"ooura_fft_tables_neon_sse2.h",
|
||||
]
|
||||
if (is_posix || is_fuchsia) {
|
||||
cflags += [ "-msse2" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_build_with_neon) {
|
||||
sources += [
|
||||
"ooura_fft_neon.cc",
|
||||
"ooura_fft_tables_neon_sse2.h",
|
||||
]
|
||||
|
||||
deps += [ "../../../common_audio" ]
|
||||
|
||||
if (current_cpu != "arm64") {
|
||||
# Enable compilation for the NEON instruction set.
|
||||
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
|
||||
cflags += [ "-mfpu=neon" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (current_cpu == "mipsel" && mips_float_abi == "hard") {
|
||||
sources += [ "ooura_fft_mips.cc" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_library("pffft_wrapper") {
|
||||
visibility = [ "../*" ]
|
||||
sources = [
|
||||
|
|
|
@ -38,7 +38,7 @@ rtc_library("vad") {
|
|||
"../../../audio/utility:audio_frame_operations",
|
||||
"../../../common_audio",
|
||||
"../../../common_audio:common_audio_c",
|
||||
"../../../common_audio/third_party/fft4g",
|
||||
"../../../common_audio/third_party/ooura/fft_size_256:fft4g",
|
||||
"../../../rtc_base:checks",
|
||||
"../../audio_coding:isac_vad",
|
||||
]
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common_audio/third_party/fft4g/fft4g.h"
|
||||
#include "common_audio/third_party/ooura/fft_size_256/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"
|
||||
|
|
|
@ -68,7 +68,7 @@ LIB_TO_LICENSES_DICT = {
|
|||
'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'],
|
||||
'ooura': ['common_audio/third_party/ooura/LICENSE'],
|
||||
'spl_sqrt_floor': ['common_audio/third_party/spl_sqrt_floor/LICENSE'],
|
||||
|
||||
# TODO(bugs.webrtc.org/1110): Remove this hack. This is not a lib.
|
||||
|
|
Loading…
Reference in a new issue