Diff
Modified: trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt 2020-03-25 15:53:05 UTC (rev 258982)
@@ -334,7 +334,6 @@
Source/third_party/libyuv/source/scale_neon64.cc
Source/third_party/libyuv/source/video_common.cc
Source/third_party/pffft/src/pffft.c
- Source/third_party/rnnoise/src/kiss_fft.cc
Source/third_party/rnnoise/src/rnn_vad_weights.cc
Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_asconf.c
Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_auth.c
Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/ChangeLog 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1,3 +1,14 @@
+2020-03-25 youenn fablet <you...@apple.com>
+
+ Bump rnnoise to M82
+ https://bugs.webkit.org/show_bug.cgi?id=209541
+
+ Reviewed by Eric Carlson.
+
+ * CMakeLists.txt:
+ * Source/third_party/rnnoise: Updated.
+ * libwebrtc.xcodeproj/project.pbxproj:
+
2020-03-19 Alex Christensen <achristen...@webkit.org>
Cherry pick usrsctp commit 790a7a2555aefb392a5a69923f1e9d17b4968467
Modified: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/BUILD.gn (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/BUILD.gn 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/BUILD.gn 2020-03-25 15:53:05 UTC (rev 258982)
@@ -5,19 +5,9 @@
import("//testing/test.gni")
group("rnnoise") {
- deps = [
- ":kiss_fft",
- ":rnn_vad",
- ]
+ deps = [ ":rnn_vad" ]
}
-source_set("kiss_fft") {
- sources = [
- "src/kiss_fft.cc",
- "src/kiss_fft.h",
- ]
-}
-
source_set("rnn_vad") {
sources = [
"src/rnn_activations.h",
@@ -25,14 +15,3 @@
"src/rnn_vad_weights.h",
]
}
-
-test("kiss_fft_unittest") {
- sources = [
- "src/kiss_fft_unittest.cc",
- ]
- deps = [
- ":kiss_fft",
- "//testing/gtest",
- "//testing/gtest:gtest_main",
- ]
-}
Deleted: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/DEPS (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/DEPS 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/DEPS 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1,3 +0,0 @@
-include_rules = [
- "+testing/gtest/include/gtest",
-]
Modified: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/OWNERS (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/OWNERS 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/OWNERS 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1,2 +1,3 @@
aless...@chromium.org
ale...@chromium.org
+# COMPONENT: Tools
Modified: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/README.chromium (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/README.chromium 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/README.chromium 2020-03-25 15:53:05 UTC (rev 258982)
@@ -25,4 +25,5 @@
* rnn_vad_weights.h: output layer sizes + weights scaling factor
* removing unwanted extern from constants in rnn_vad_weights.h and using
constants to declare array sizes
-* Add braces around arrays in unit test.
\ No newline at end of file
+* Add braces around arrays in unit test.
+* KissFFT removed
Deleted: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft.cc (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft.cc 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft.cc 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1,443 +0,0 @@
-/*Copyright (c) 2003-2004, Mark Borgerding
- Lots of modifications by Jean-Marc Valin
- Copyright (c) 2005-2007, Xiph.Org Foundation
- Copyright (c) 2008, Xiph.Org Foundation, CSIRO
- Copyright (c) 2018, The WebRTC project authors
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.*/
-
-#include "third_party/rnnoise/src/kiss_fft.h"
-
-#include <cassert>
-#include <cmath>
-#include <utility>
-
-namespace rnnoise {
-namespace {
-
-void kf_bfly2(std::complex<float>* Fout, int m, int N) {
- if (m == 1) {
- for (int i = 0; i < N; i++) {
- const std::complex<float> t = Fout[1];
- Fout[1] = Fout[0] - t;
- Fout[0] += t;
- Fout += 2;
- }
- } else {
- constexpr float tw = 0.7071067812f;
- // We know that m==4 here because the radix-2 is just after a radix-4.
- assert(m == 4);
- for (int i = 0; i < N; i++) {
- std::complex<float>* Fout2 = Fout + 4;
- std::complex<float> t = Fout2[0];
-
- *Fout2 = Fout[0] - t;
- Fout[0] += t;
-
- t.real((Fout2[1].real() + Fout2[1].imag()) * tw);
- t.imag((Fout2[1].imag() - Fout2[1].real()) * tw);
- Fout2[1] = Fout[1] - t;
- Fout[1] += t;
-
- t.real(Fout2[2].imag());
- t.imag(-Fout2[2].real());
- Fout2[2] = Fout[2] - t;
- Fout[2] += t;
-
- t.real((Fout2[3].imag() - Fout2[3].real()) * tw);
- t.imag(-(Fout2[3].imag() + Fout2[3].real()) * tw);
- Fout2[3] = Fout[3] - t;
- Fout[3] += t;
- Fout += 8;
- }
- }
-}
-
-void kf_bfly4(std::complex<float>* Fout,
- const size_t fstride,
- const KissFft::KissFftState* st,
- int m,
- int N,
- int mm) {
- assert(Fout);
- assert(st);
- if (m == 1) {
- // Degenerate case where all the twiddles are 1.
- for (int i = 0; i < N; i++) {
- std::complex<float> scratch0 = Fout[0] - Fout[2];
- Fout[0] += Fout[2];
- std::complex<float> scratch1 = Fout[1] + Fout[3];
- Fout[2] = Fout[0] - scratch1;
- Fout[0] += scratch1;
- scratch1 = Fout[1] - Fout[3];
-
- Fout[1].real(scratch0.real() + scratch1.imag());
- Fout[1].imag(scratch0.imag() - scratch1.real());
- Fout[3].real(scratch0.real() - scratch1.imag());
- Fout[3].imag(scratch0.imag() + scratch1.real());
- Fout += 4;
- }
- } else {
- std::complex<float> scratch[6];
- const int m2 = 2 * m;
- const int m3 = 3 * m;
- std::complex<float>* Fout_beg = Fout;
- for (int i = 0; i < N; i++) {
- Fout = Fout_beg + i * mm;
- const std::complex<float>* tw1;
- const std::complex<float>* tw2;
- const std::complex<float>* tw3;
- tw3 = tw2 = tw1 = &st->twiddles[0];
- assert(m % 4 == 0); // |m| is guaranteed to be a multiple of 4.
- for (int j = 0; j < m; j++) {
- scratch[0] = Fout[m] * *tw1;
- scratch[1] = Fout[m2] * *tw2;
- scratch[2] = Fout[m3] * *tw3;
-
- scratch[5] = Fout[0] - scratch[1];
- Fout[0] += scratch[1];
- scratch[3] = scratch[0] + scratch[2];
- scratch[4] = scratch[0] - scratch[2];
- Fout[m2] = Fout[0] - scratch[3];
-
- tw1 += fstride;
- tw2 += fstride * 2;
- tw3 += fstride * 3;
- Fout[0] += scratch[3];
-
- Fout[m].real(scratch[5].real() + scratch[4].imag());
- Fout[m].imag(scratch[5].imag() - scratch[4].real());
- Fout[m3].real(scratch[5].real() - scratch[4].imag());
- Fout[m3].imag(scratch[5].imag() + scratch[4].real());
- ++Fout;
- }
- }
- }
-}
-
-void kf_bfly3(std::complex<float>* Fout,
- const size_t fstride,
- const KissFft::KissFftState* st,
- int m,
- int N,
- int mm) {
- assert(Fout);
- assert(st);
- const size_t m2 = 2 * m;
- const std::complex<float>*tw1, *tw2;
- std::complex<float> scratch[5];
- std::complex<float> epi3;
-
- std::complex<float>* Fout_beg = Fout;
- epi3 = st->twiddles[fstride * m];
- for (int i = 0; i < N; i++) {
- Fout = Fout_beg + i * mm;
- tw1 = tw2 = &st->twiddles[0];
- size_t k = m;
- do {
- scratch[1] = Fout[m] * *tw1;
- scratch[2] = Fout[m2] * *tw2;
-
- scratch[3] = scratch[1] + scratch[2];
- scratch[0] = scratch[1] - scratch[2];
- tw1 += fstride;
- tw2 += fstride * 2;
-
- Fout[m] = Fout[0] - 0.5f * scratch[3];
-
- scratch[0] *= epi3.imag();
-
- Fout[0] += scratch[3];
-
- Fout[m2].real(Fout[m].real() + scratch[0].imag());
- Fout[m2].imag(Fout[m].imag() - scratch[0].real());
-
- Fout[m].real(Fout[m].real() - scratch[0].imag());
- Fout[m].imag(Fout[m].imag() + scratch[0].real());
-
- ++Fout;
- } while (--k);
- }
-}
-
-void kf_bfly5(std::complex<float>* Fout,
- const size_t fstride,
- const KissFft::KissFftState* st,
- int m,
- int N,
- int mm) {
- assert(Fout);
- assert(st);
- std::complex<float> scratch[13];
- const std::complex<float>* tw;
- std::complex<float> ya, yb;
- std::complex<float>* const Fout_beg = Fout;
-
- ya = st->twiddles[fstride * m];
- yb = st->twiddles[fstride * 2 * m];
- tw = &st->twiddles[0];
-
- for (int i = 0; i < N; i++) {
- Fout = Fout_beg + i * mm;
- std::complex<float>* Fout0 = Fout;
- std::complex<float>* Fout1 = Fout0 + m;
- std::complex<float>* Fout2 = Fout0 + 2 * m;
- std::complex<float>* Fout3 = Fout0 + 3 * m;
- std::complex<float>* Fout4 = Fout0 + 4 * m;
-
- // For non-custom modes, m is guaranteed to be a multiple of 4.
- for (int u = 0; u < m; ++u) {
- scratch[0] = *Fout0;
-
- scratch[1] = *Fout1 * tw[u * fstride];
- scratch[2] = *Fout2 * tw[2 * u * fstride];
- scratch[3] = *Fout3 * tw[3 * u * fstride];
- scratch[4] = *Fout4 * tw[4 * u * fstride];
-
- scratch[7] = scratch[1] + scratch[4];
- scratch[10] = scratch[1] - scratch[4];
- scratch[8] = scratch[2] + scratch[3];
- scratch[9] = scratch[2] - scratch[3];
-
- Fout0->real(Fout0->real() + scratch[7].real() + scratch[8].real());
- Fout0->imag(Fout0->imag() + scratch[7].imag() + scratch[8].imag());
-
- scratch[5].real(scratch[0].real() + scratch[7].real() * ya.real() +
- scratch[8].real() * yb.real());
- scratch[5].imag(scratch[0].imag() + scratch[7].imag() * ya.real() +
- scratch[8].imag() * yb.real());
-
- scratch[6].real(scratch[10].imag() * ya.imag() +
- scratch[9].imag() * yb.imag());
- scratch[6].imag(
- -(scratch[10].real() * ya.imag() + scratch[9].real() * yb.imag()));
-
- *Fout1 = scratch[5] - scratch[6];
- *Fout4 = scratch[5] + scratch[6];
-
- scratch[11].real(scratch[0].real() + scratch[7].real() * yb.real() +
- scratch[8].real() * ya.real());
- scratch[11].imag(scratch[0].imag() + scratch[7].imag() * yb.real() +
- scratch[8].imag() * ya.real());
- scratch[12].real(scratch[9].imag() * ya.imag() -
- scratch[10].imag() * yb.imag());
- scratch[12].imag(scratch[10].real() * yb.imag() -
- scratch[9].real() * ya.imag());
-
- *Fout2 = scratch[11] + scratch[12];
- *Fout3 = scratch[11] - scratch[12];
-
- ++Fout0;
- ++Fout1;
- ++Fout2;
- ++Fout3;
- ++Fout4;
- }
- }
-}
-
-void compute_bitrev_table(int base_index,
- const size_t stride,
- const int16_t* factors,
- const KissFft::KissFftState* st,
- const int16_t* bitrev_table_last,
- int16_t* bitrev_table) {
- const int p = *factors++; // The radix.
- const int m = *factors++; // Stage's fft length/p.
- if (m == 1) {
- for (int j = 0; j < p; j++) {
- assert(bitrev_table <= bitrev_table_last);
- *bitrev_table = base_index + j;
- bitrev_table += stride;
- }
- } else {
- for (int j = 0; j < p; j++) {
- compute_bitrev_table(base_index, stride * p, factors, st,
- bitrev_table_last, bitrev_table);
- bitrev_table += stride;
- base_index += m;
- }
- }
-}
-
-// Populates |facbuf| with p1, m1, p2, m2, ... where p[i] * m[i] = m[i-1] and
-// m0 = n.
-bool kf_factor(int n, int16_t* facbuf) {
- assert(facbuf);
- int p = 4;
- int stages = 0;
- int nbak = n;
-
- // Factor out powers of 4, powers of 2, then any remaining primes.
- do {
- while (n % p) {
- switch (p) {
- case 4:
- p = 2;
- break;
- case 2:
- p = 3;
- break;
- default:
- p += 2;
- break;
- }
- if (p > 32000 || p * p > n)
- p = n; // No more factors, skip to end.
- }
- n /= p;
- if (p > 5)
- return false;
- facbuf[2 * stages] = p;
- if (p == 2 && stages > 1) {
- facbuf[2 * stages] = 4;
- facbuf[2] = 2;
- }
- stages++;
- } while (n > 1);
- n = nbak;
- // Reverse the order to get the radix 4 at the end, so we can use the
- // fast degenerate case. It turns out that reversing the order also
- // improves the noise behavior.
- for (int i = 0; i < stages / 2; i++)
- std::swap(facbuf[2 * i], facbuf[2 * (stages - i - 1)]);
- for (int i = 0; i < stages; i++) {
- n /= facbuf[2 * i];
- facbuf[2 * i + 1] = n;
- }
- return true;
-}
-
-void compute_twiddles(const int nfft, std::complex<float>* twiddles) {
- constexpr double pi = 3.14159265358979323846264338327;
- assert(twiddles);
- for (int i = 0; i < nfft; ++i) {
- const double phase = (-2 * pi / nfft) * i;
- twiddles[i].real(std::cos(phase));
- twiddles[i].imag(std::sin(phase));
- }
-}
-
-void fft_impl(const KissFft::KissFftState* st, std::complex<float>* fout) {
- assert(st);
- assert(fout);
- int m2, m;
- int p;
- int L;
- int fstride[KissFft::kMaxFactors];
-
- fstride[0] = 1;
- L = 0;
- do {
- p = st->factors[2 * L];
- m = st->factors[2 * L + 1];
- assert(static_cast<size_t>(L + 1) < KissFft::kMaxFactors);
- fstride[L + 1] = fstride[L] * p;
- L++;
- } while (m != 1);
- m = st->factors[2 * L - 1];
- for (int i = L - 1; i >= 0; i--) {
- if (i != 0)
- m2 = st->factors[2 * i - 1];
- else
- m2 = 1;
- switch (st->factors[2 * i]) {
- case 2:
- kf_bfly2(fout, m, fstride[i]);
- break;
- case 4:
- kf_bfly4(fout, fstride[i], st, m, fstride[i], m2);
- break;
- case 3:
- kf_bfly3(fout, fstride[i], st, m, fstride[i], m2);
- break;
- case 5:
- kf_bfly5(fout, fstride[i], st, m, fstride[i], m2);
- break;
- default:
- assert(0);
- break;
- }
- m = m2;
- }
-}
-
-} // namespace
-
-KissFft::KissFftState::KissFftState(int num_fft_points)
- : nfft(num_fft_points), scale(1.f / nfft) {
- // Factorize |nfft|.
- // TODO(alessiob): Handle kf_factor fails (invalid nfft).
- if (!kf_factor(nfft, factors.data()))
- assert(0);
- // Twiddles.
- twiddles.resize(nfft);
- compute_twiddles(nfft, twiddles.data());
- // Bit-reverse table.
- bitrev.resize(nfft);
- compute_bitrev_table(0, 1, factors.data(), this, &bitrev.back(),
- bitrev.data());
-}
-
-KissFft::KissFftState::~KissFftState() = default;
-
-KissFft::KissFft(const int nfft) : state_(nfft) {}
-
-KissFft::~KissFft() = default;
-
-void KissFft::ForwardFft(const size_t in_size,
- const std::complex<float>* in,
- const size_t out_size,
- std::complex<float>* out) {
- assert(in);
- assert(out);
- assert(in != out); // In-place FFT not supported.
- assert(state_.nfft == static_cast<int>(in_size));
- assert(state_.nfft == static_cast<int>(out_size));
- // Bit-reverse the input.
- for (int i = 0; i < state_.nfft; i++)
- out[state_.bitrev[i]] = state_.scale * in[i];
- fft_impl(&state_, out);
-}
-
-void KissFft::ReverseFft(const size_t in_size,
- const std::complex<float>* in,
- const size_t out_size,
- std::complex<float>* out) {
- assert(in);
- assert(out);
- assert(in != out); // In-place IFFT not supported.
- assert(state_.nfft == static_cast<int>(in_size));
- assert(state_.nfft == static_cast<int>(out_size));
- // Bit-reverse the input.
- for (int i = 0; i < state_.nfft; i++)
- out[state_.bitrev[i]] = in[i];
- for (int i = 0; i < state_.nfft; i++)
- out[i].imag(-out[i].imag());
- fft_impl(&state_, out);
- for (int i = 0; i < state_.nfft; i++)
- out[i].imag(-out[i].imag());
-}
-
-} // namespace rnnoise
Deleted: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft.h (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft.h 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft.h 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1,78 +0,0 @@
-/*Copyright (c) 2003-2004, Mark Borgerding
- Lots of modifications by Jean-Marc Valin
- Copyright (c) 2005-2007, Xiph.Org Foundation
- Copyright (c) 2008, Xiph.Org Foundation, CSIRO
- Copyright (c) 2018, The WebRTC project authors
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.*/
-
-#ifndef THIRD_PARTY_RNNOISE_SRC_KISS_FFT_H_
-#define THIRD_PARTY_RNNOISE_SRC_KISS_FFT_H_
-
-#include <array>
-#include <complex>
-#include <vector>
-
-namespace rnnoise {
-
-class KissFft {
- public:
- // Example: an FFT of length 128 has 4 factors as far as kissfft is concerned
- // (namely, 4*4*4*2).
- static const size_t kMaxFactors = 8;
-
- class KissFftState {
- public:
- KissFftState(int num_fft_points);
- KissFftState(const KissFftState&) = delete;
- KissFftState& operator=(const KissFftState&) = delete;
- ~KissFftState();
-
- const int nfft;
- const float scale;
- std::array<int16_t, 2 * kMaxFactors> factors;
- std::vector<int16_t> bitrev;
- std::vector<std::complex<float>> twiddles;
- };
-
- explicit KissFft(const int nfft);
- KissFft(const KissFft&) = delete;
- KissFft& operator=(const KissFft&) = delete;
- ~KissFft();
- void ForwardFft(const size_t in_size,
- const std::complex<float>* in,
- const size_t out_size,
- std::complex<float>* out);
- void ReverseFft(const size_t in_size,
- const std::complex<float>* in,
- const size_t out_size,
- std::complex<float>* out);
-
- private:
- KissFftState state_;
-};
-
-} // namespace rnnoise
-
-#endif // THIRD_PARTY_RNNOISE_SRC_KISS_FFT_H_
Deleted: trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft_unittest.cc (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft_unittest.cc 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/Source/third_party/rnnoise/src/kiss_fft_unittest.cc 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1,145 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <array>
-#include <cmath>
-#include <limits>
-#include <tuple>
-#include <vector>
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/rnnoise/src/kiss_fft.h"
-
-namespace rnnoise {
-namespace test {
-namespace {
-
-const double kPi = std::acos(-1.0);
-
-void FillFftInputBuffer(const size_t num_samples,
- const float* samples,
- std::complex<float>* input_buf) {
- for (size_t i = 0; i < num_samples; ++i)
- input_buf[i].real(samples[i]);
-}
-
-void CheckFftResult(const size_t num_fft_points,
- const float* expected_real,
- const float* expected_imag,
- const std::complex<float>* computed,
- const float tolerance) {
- for (size_t i = 0; i < num_fft_points; ++i) {
- SCOPED_TRACE(i);
- EXPECT_NEAR(expected_real[i], computed[i].real(), tolerance);
- EXPECT_NEAR(expected_imag[i], computed[i].imag(), tolerance);
- }
-}
-
-} // namespace
-
-class RnnVadTest
- : public testing::Test,
- public ::testing::WithParamInterface<std::tuple<size_t, float, float>> {};
-
-// Check that IFFT(FFT(x)) == x (tolerating round-off errors).
-TEST_P(RnnVadTest, KissFftForwardReverseCheckIdentity) {
- const auto params = GetParam();
- const float amplitude = std::get<0>(params);
- const size_t num_fft = std::get<1>(params);
- const float tolerance = std::get<2>(params);
- std::vector<float> samples;
- std::vector<float> zeros;
- samples.resize(num_fft);
- zeros.resize(num_fft);
- for (size_t i = 0; i < num_fft; ++i) {
- samples[i] = amplitude * std::sin(2.f * kPi * 10 * i / num_fft);
- zeros[i] = 0.f;
- }
-
- KissFft fft(num_fft);
- std::vector<std::complex<float>> fft_buf_1;
- fft_buf_1.resize(num_fft);
- std::vector<std::complex<float>> fft_buf_2;
- fft_buf_2.resize(num_fft);
-
- FillFftInputBuffer(samples.size(), samples.data(), fft_buf_1.data());
- {
- // TODO(alessiob): Underflow with non power of 2 frame sizes.
- // FloatingPointExceptionObserver fpe_observer;
-
- fft.ForwardFft(fft_buf_1.size(), fft_buf_1.data(), fft_buf_2.size(),
- fft_buf_2.data());
- fft.ReverseFft(fft_buf_2.size(), fft_buf_2.data(), fft_buf_1.size(),
- fft_buf_1.data());
- }
- CheckFftResult(samples.size(), samples.data(), zeros.data(), fft_buf_1.data(),
- tolerance);
-}
-
-INSTANTIATE_TEST_CASE_P(FftPoints,
- RnnVadTest,
- ::testing::Values(std::make_tuple(1.f, 240, 3e-7f),
- std::make_tuple(1.f, 256, 3e-7f),
- std::make_tuple(1.f, 480, 3e-7f),
- std::make_tuple(1.f, 512, 3e-7f),
- std::make_tuple(1.f, 960, 4e-7f),
- std::make_tuple(1.f, 1024, 3e-7f),
- std::make_tuple(30.f, 240, 5e-6f),
- std::make_tuple(30.f, 256, 5e-6f),
- std::make_tuple(30.f, 480, 6e-6f),
- std::make_tuple(30.f, 512, 6e-6f),
- std::make_tuple(30.f, 960, 8e-6f),
- std::make_tuple(30.f, 1024, 6e-6f)));
-
-TEST(RnnVadTest, KissFftBitExactness) {
- constexpr std::array<float, 32> samples = {
- {0.3524301946163177490234375f, 0.891803801059722900390625f,
- 0.07706542313098907470703125f, 0.699530780315399169921875f,
- 0.3789891898632049560546875f, 0.5438187122344970703125f,
- 0.332781612873077392578125f, 0.449340641498565673828125f,
- 0.105229437351226806640625f, 0.722373783588409423828125f,
- 0.13155306875705718994140625f, 0.340857982635498046875f,
- 0.970204889774322509765625f, 0.53061950206756591796875f,
- 0.91507828235626220703125f, 0.830274522304534912109375f,
- 0.74468600749969482421875f, 0.24320767819881439208984375f,
- 0.743998110294342041015625f, 0.17574800550937652587890625f,
- 0.1834825575351715087890625f, 0.63317775726318359375f,
- 0.11414264142513275146484375f, 0.1612723171710968017578125f,
- 0.80316197872161865234375f, 0.4979794919490814208984375f,
- 0.554282128810882568359375f, 0.67189347743988037109375f,
- 0.06660757958889007568359375f, 0.89568817615509033203125f,
- 0.29327380657196044921875f, 0.3472573757171630859375f}};
- constexpr std::array<float, 17> expected_real = {
- {0.4813065826892852783203125f, -0.0246877372264862060546875f,
- 0.04095232486724853515625f, -0.0401695556938648223876953125f,
- 0.00500857271254062652587890625f, 0.0160773508250713348388671875f,
- -0.011385642923414707183837890625f, -0.008461721241474151611328125f,
- 0.01383177936077117919921875f, 0.0117270611226558685302734375f,
- -0.0164460353553295135498046875f, 0.0585579685866832733154296875f,
- 0.02038039825856685638427734375f, -0.0209107734262943267822265625f,
- 0.01046995259821414947509765625f, -0.09019653499126434326171875f,
- -0.0583711564540863037109375f}};
- constexpr std::array<float, 17> expected_imag = {
- {0.f, -0.010482530109584331512451171875f, 0.04762755334377288818359375f,
- -0.0558677613735198974609375f, 0.007908363826572895050048828125f,
- -0.0071932487189769744873046875f, 0.01322011835873126983642578125f,
- -0.011227893643081188201904296875f, -0.0400779247283935546875f,
- -0.0290451310575008392333984375f, 0.01519204117357730865478515625f,
- -0.09711246192455291748046875f, -0.00136523949913680553436279296875f,
- 0.038602568209171295166015625f, -0.009693108499050140380859375f,
- -0.0183933563530445098876953125f, 0.f}};
-
- KissFft fft(32);
- std::array<std::complex<float>, 32> fft_buf_in;
- std::array<std::complex<float>, 32> fft_buf_out;
- FillFftInputBuffer(samples.size(), samples.data(), fft_buf_in.data());
- fft.ForwardFft(fft_buf_in.size(), fft_buf_in.data(), fft_buf_out.size(),
- fft_buf_out.data());
- CheckFftResult(expected_real.size(), expected_real.data(),
- expected_imag.data(), fft_buf_out.data(),
- std::numeric_limits<float>::min());
-}
-
-} // namespace test
-} // namespace rnnoise
Modified: trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj (258981 => 258982)
--- trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj 2020-03-25 15:20:05 UTC (rev 258981)
+++ trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj 2020-03-25 15:53:05 UTC (rev 258982)
@@ -1329,8 +1329,6 @@
419241902127581000634FCF /* fec_private_tables_bursty.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4192418F2127581000634FCF /* fec_private_tables_bursty.cc */; };
419241982127586500634FCF /* rnn_vad_weights.h in Headers */ = {isa = PBXBuildFile; fileRef = 419241932127586400634FCF /* rnn_vad_weights.h */; };
419241992127586500634FCF /* rnn_vad_weights.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419241942127586400634FCF /* rnn_vad_weights.cc */; };
- 4192419A2127586500634FCF /* kiss_fft.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419241952127586500634FCF /* kiss_fft.cc */; };
- 4192419B2127586500634FCF /* kiss_fft.h in Headers */ = {isa = PBXBuildFile; fileRef = 419241962127586500634FCF /* kiss_fft.h */; };
4192419C2127586500634FCF /* rnn_activations.h in Headers */ = {isa = PBXBuildFile; fileRef = 419241972127586500634FCF /* rnn_activations.h */; };
4192419F2127588300634FCF /* audio_codec_pair_id.h in Headers */ = {isa = PBXBuildFile; fileRef = 4192419D2127588200634FCF /* audio_codec_pair_id.h */; };
419241A02127588300634FCF /* audio_codec_pair_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4192419E2127588200634FCF /* audio_codec_pair_id.cc */; };
@@ -5237,8 +5235,6 @@
4192418F2127581000634FCF /* fec_private_tables_bursty.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fec_private_tables_bursty.cc; sourceTree = "<group>"; };
419241932127586400634FCF /* rnn_vad_weights.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rnn_vad_weights.h; path = src/rnn_vad_weights.h; sourceTree = "<group>"; };
419241942127586400634FCF /* rnn_vad_weights.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rnn_vad_weights.cc; path = src/rnn_vad_weights.cc; sourceTree = "<group>"; };
- 419241952127586500634FCF /* kiss_fft.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = kiss_fft.cc; path = src/kiss_fft.cc; sourceTree = "<group>"; };
- 419241962127586500634FCF /* kiss_fft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = kiss_fft.h; path = src/kiss_fft.h; sourceTree = "<group>"; };
419241972127586500634FCF /* rnn_activations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rnn_activations.h; path = src/rnn_activations.h; sourceTree = "<group>"; };
4192419D2127588200634FCF /* audio_codec_pair_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audio_codec_pair_id.h; path = audio_codecs/audio_codec_pair_id.h; sourceTree = "<group>"; };
4192419E2127588200634FCF /* audio_codec_pair_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audio_codec_pair_id.cc; path = audio_codecs/audio_codec_pair_id.cc; sourceTree = "<group>"; };
@@ -9249,8 +9245,6 @@
419241922127585000634FCF /* src */ = {
isa = PBXGroup;
children = (
- 419241952127586500634FCF /* kiss_fft.cc */,
- 419241962127586500634FCF /* kiss_fft.h */,
419241972127586500634FCF /* rnn_activations.h */,
419241942127586400634FCF /* rnn_vad_weights.cc */,
419241932127586400634FCF /* rnn_vad_weights.h */,
@@ -14886,7 +14880,6 @@
5C63F8DE1E416D53002CA531 /* json.h in Headers */,
4131C038234B898D0028A615 /* keep_ref_until_done.h in Headers */,
5C0885301E4A99D200403995 /* key.h in Headers */,
- 4192419B2127586500634FCF /* kiss_fft.h in Headers */,
5CDD84201E439B2900621E92 /* legacy_encoded_audio_frame.h in Headers */,
5CDD84B91E43AF1300621E92 /* level_estimator_impl.h in Headers */,
413E67732169863B00EF37ED /* libvpx_interface.h in Headers */,
@@ -17363,7 +17356,6 @@
4131BF44234B88200028A615 /* jsep_transport.cc in Sources */,
4131BEFC234B88200028A615 /* jsep_transport_controller.cc in Sources */,
4131C227234B8BB20028A615 /* keyframe_interval_settings.cc in Sources */,
- 4192419A2127586500634FCF /* kiss_fft.cc in Sources */,
5CDD87C41E43BC0500621E92 /* lattice.c in Sources */,
41433CF21F79B33400387B4D /* lattice.c in Sources */,
41433D141F79B33400387B4D /* lattice_c.c in Sources */,