Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
3.1 KiB
C
Raw Normal View History

Reland "Reland "AGC2 RNN VAD: initial build targets"" This reverts commit 772d43d4c0acbbc09c3dc280c0ffd17e9569700b. Reason for revert: fix issues and reland revert Original change's description: > Revert "Reland "AGC2 RNN VAD: initial build targets"" > > This reverts commit e0031500bafa4b114adfb2d29444592f1e7b3795. > > Reason for revert: reland automatically landed by mistake > > Original change's description: > > Reland "AGC2 RNN VAD: initial build targets" > > > > This reverts commit a153c00bceb832e697365f52e6a7697fdf210efa. > > > > Reason for revert: fix issues and reland revert > > > > Original change's description: > > > Revert "AGC2 RNN VAD: initial build targets" > > > > > > This reverts commit 8628f5bb7c7f5bd0373567095af08cebe8bb7f8d. > > > > > > Reason for revert: iOS buildbot failing > > > > > > Original change's description: > > > > AGC2 RNN VAD: initial build targets > > > > > > > > rnn_vad_tool is an executable that reads a wav file of any sample rate > > > > compatible with 10 ms frames that are resampled and, when the VAD is > > > > fully landed, will process the resampled frames to compute the VAD > > > > probability. > > > > > > > > To avoid mac, win and ios trybot failures, to_be_removed.h/.cc have > > > > been added and will be removed as soon as the :lib target includes > > > > code that leads to a non-empty static lib file on those platforms. > > > > > > > > Bug: webrtc:9076 > > > > Change-Id: I810c08acfa1adf2029e3baac2adda3045ae5214a > > > > Reviewed-on: https://webrtc-review.googlesource.com/70202 > > > > Reviewed-by: Alex Loiko <aleloi@webrtc.org> > > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > > Cr-Commit-Position: refs/heads/master@{#22898} > > > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > > > Change-Id: Ic6014dde78b0ef371804c52608145ba8acdd9c97 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:9076 > > > Reviewed-on: https://webrtc-review.googlesource.com/70144 > > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > Cr-Commit-Position: refs/heads/master@{#22899} > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > Change-Id: I55e5a77274684b4cff3c950ca3514cc769d5dc26 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: webrtc:9076 > > Reviewed-on: https://webrtc-review.googlesource.com/70145 > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22901} > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > Change-Id: Ia6a837f79ac3f12aa4b0659938454141c69fee61 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9076 > Reviewed-on: https://webrtc-review.googlesource.com/70520 > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22902} TBR=alessiob@webrtc.org,aleloi@webrtc.org Change-Id: If0884ab59d66ac3ba6460dbfe14a083f20493c10 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9076 Reviewed-on: https://webrtc-review.googlesource.com/70521 Reviewed-by: Minyue Li <minyue@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22904}
2018-04-17 15:58:40 +02:00
/*
* 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.
*/
#ifndef MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_COMMON_H_
#define MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_COMMON_H_
Reland "RNN VAD: prepare for SIMD optimization" This reverts commit 5ab21f8853892205594ae8559a00b431f30a8a06. Reason for revert: downstream fixed Original change's description: > Revert "RNN VAD: prepare for SIMD optimization" > > This reverts commit 7350a902374c796dec8ce583cfaf4b9697f3a525. > > Reason for revert: possibly breaking downstream projects > > Original change's description: > > RNN VAD: prepare for SIMD optimization > > > > This CL adds the boilerplate for SIMD optimization of FC and GRU layers > > in rnn.cc. The same scheme of AEC3 has been used. Unit tests for the > > optimized architectures have been added (the same unoptimized > > implementation will run). > > > > Minor changes: > > - unnecessary const removed in rnn.h > > - FC and GRU test data in the anon namespace as constexpr > > > > Bug: webrtc:10480 > > Change-Id: Ifae4e970326e7e7c603d49aeaf61194b5efdabd3 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141419 > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#29696} > > TBR=gustaf@webrtc.org,alessiob@webrtc.org,fhernqvist@webrtc.org > > Change-Id: I9ae82f4bd2d30797646fabfb5ad16bea378208b8 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10480 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158893 > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#29699} TBR=gustaf@webrtc.org,alessiob@webrtc.org,fhernqvist@webrtc.org Change-Id: I33edd144f7ac795bf472aae9fa5a79c326000443 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:10480 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159001 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29708}
2019-11-06 14:42:32 +00:00
#include <stddef.h>
Reland "Reland "AGC2 RNN VAD: initial build targets"" This reverts commit 772d43d4c0acbbc09c3dc280c0ffd17e9569700b. Reason for revert: fix issues and reland revert Original change's description: > Revert "Reland "AGC2 RNN VAD: initial build targets"" > > This reverts commit e0031500bafa4b114adfb2d29444592f1e7b3795. > > Reason for revert: reland automatically landed by mistake > > Original change's description: > > Reland "AGC2 RNN VAD: initial build targets" > > > > This reverts commit a153c00bceb832e697365f52e6a7697fdf210efa. > > > > Reason for revert: fix issues and reland revert > > > > Original change's description: > > > Revert "AGC2 RNN VAD: initial build targets" > > > > > > This reverts commit 8628f5bb7c7f5bd0373567095af08cebe8bb7f8d. > > > > > > Reason for revert: iOS buildbot failing > > > > > > Original change's description: > > > > AGC2 RNN VAD: initial build targets > > > > > > > > rnn_vad_tool is an executable that reads a wav file of any sample rate > > > > compatible with 10 ms frames that are resampled and, when the VAD is > > > > fully landed, will process the resampled frames to compute the VAD > > > > probability. > > > > > > > > To avoid mac, win and ios trybot failures, to_be_removed.h/.cc have > > > > been added and will be removed as soon as the :lib target includes > > > > code that leads to a non-empty static lib file on those platforms. > > > > > > > > Bug: webrtc:9076 > > > > Change-Id: I810c08acfa1adf2029e3baac2adda3045ae5214a > > > > Reviewed-on: https://webrtc-review.googlesource.com/70202 > > > > Reviewed-by: Alex Loiko <aleloi@webrtc.org> > > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > > Cr-Commit-Position: refs/heads/master@{#22898} > > > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > > > Change-Id: Ic6014dde78b0ef371804c52608145ba8acdd9c97 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:9076 > > > Reviewed-on: https://webrtc-review.googlesource.com/70144 > > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > Cr-Commit-Position: refs/heads/master@{#22899} > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > Change-Id: I55e5a77274684b4cff3c950ca3514cc769d5dc26 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: webrtc:9076 > > Reviewed-on: https://webrtc-review.googlesource.com/70145 > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22901} > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > Change-Id: Ia6a837f79ac3f12aa4b0659938454141c69fee61 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9076 > Reviewed-on: https://webrtc-review.googlesource.com/70520 > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22902} TBR=alessiob@webrtc.org,aleloi@webrtc.org Change-Id: If0884ab59d66ac3ba6460dbfe14a083f20493c10 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9076 Reviewed-on: https://webrtc-review.googlesource.com/70521 Reviewed-by: Minyue Li <minyue@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22904}
2018-04-17 15:58:40 +02:00
namespace webrtc {
namespace rnn_vad {
constexpr double kPi = 3.14159265358979323846;
constexpr int kSampleRate24kHz = 24000;
constexpr int kFrameSize10ms24kHz = kSampleRate24kHz / 100;
constexpr int kFrameSize20ms24kHz = kFrameSize10ms24kHz * 2;
Reland "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." This reverts commit d38ce9f82402a995289b87e044125847d12eb658. Reason for revert: land this first, then fix downstream Original change's description: > Revert "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." > > This reverts commit 8fcd6537f242ffd74154a62dad410e573e2efc4b. > > Reason for revert: broke internal projects. > > Original change's description: > > RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation. > > > > Bug: webrtc:9577, webrtc:10480 > > Change-Id: I6d58866d48b8eaaa4102551b88d4f55133d1915c > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130482 > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#27387} > > TBR=gustaf@webrtc.org,alessiob@webrtc.org > > Change-Id: Ia05057326ebc277f334b13db0bfec9d4442903c2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9577, webrtc:10480 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130369 > Reviewed-by: Qingsi Wang <qingsi@webrtc.org> > Commit-Queue: Qingsi Wang <qingsi@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#27405} TBR=gustaf@webrtc.org,alessiob@webrtc.org,qingsi@webrtc.org Change-Id: I345f00d798fb67d0f02bf1e89319dac7f0287485 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9577, webrtc:10480 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130516 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27407}
2019-04-02 06:58:45 +00:00
// Pitch buffer.
constexpr int kMinPitch24kHz = kSampleRate24kHz / 800; // 0.00125 s.
constexpr int kMaxPitch24kHz = kSampleRate24kHz / 62.5; // 0.016 s.
constexpr int kBufSize24kHz = kMaxPitch24kHz + kFrameSize20ms24kHz;
static_assert((kBufSize24kHz & 1) == 0, "The buffer size must be even.");
Reland "Reland "AGC2 RNN VAD: initial build targets"" This reverts commit 772d43d4c0acbbc09c3dc280c0ffd17e9569700b. Reason for revert: fix issues and reland revert Original change's description: > Revert "Reland "AGC2 RNN VAD: initial build targets"" > > This reverts commit e0031500bafa4b114adfb2d29444592f1e7b3795. > > Reason for revert: reland automatically landed by mistake > > Original change's description: > > Reland "AGC2 RNN VAD: initial build targets" > > > > This reverts commit a153c00bceb832e697365f52e6a7697fdf210efa. > > > > Reason for revert: fix issues and reland revert > > > > Original change's description: > > > Revert "AGC2 RNN VAD: initial build targets" > > > > > > This reverts commit 8628f5bb7c7f5bd0373567095af08cebe8bb7f8d. > > > > > > Reason for revert: iOS buildbot failing > > > > > > Original change's description: > > > > AGC2 RNN VAD: initial build targets > > > > > > > > rnn_vad_tool is an executable that reads a wav file of any sample rate > > > > compatible with 10 ms frames that are resampled and, when the VAD is > > > > fully landed, will process the resampled frames to compute the VAD > > > > probability. > > > > > > > > To avoid mac, win and ios trybot failures, to_be_removed.h/.cc have > > > > been added and will be removed as soon as the :lib target includes > > > > code that leads to a non-empty static lib file on those platforms. > > > > > > > > Bug: webrtc:9076 > > > > Change-Id: I810c08acfa1adf2029e3baac2adda3045ae5214a > > > > Reviewed-on: https://webrtc-review.googlesource.com/70202 > > > > Reviewed-by: Alex Loiko <aleloi@webrtc.org> > > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > > Cr-Commit-Position: refs/heads/master@{#22898} > > > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > > > Change-Id: Ic6014dde78b0ef371804c52608145ba8acdd9c97 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:9076 > > > Reviewed-on: https://webrtc-review.googlesource.com/70144 > > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > Cr-Commit-Position: refs/heads/master@{#22899} > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > Change-Id: I55e5a77274684b4cff3c950ca3514cc769d5dc26 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: webrtc:9076 > > Reviewed-on: https://webrtc-review.googlesource.com/70145 > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22901} > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > Change-Id: Ia6a837f79ac3f12aa4b0659938454141c69fee61 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9076 > Reviewed-on: https://webrtc-review.googlesource.com/70520 > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22902} TBR=alessiob@webrtc.org,aleloi@webrtc.org Change-Id: If0884ab59d66ac3ba6460dbfe14a083f20493c10 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9076 Reviewed-on: https://webrtc-review.googlesource.com/70521 Reviewed-by: Minyue Li <minyue@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22904}
2018-04-17 15:58:40 +02:00
Reland "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." This reverts commit d38ce9f82402a995289b87e044125847d12eb658. Reason for revert: land this first, then fix downstream Original change's description: > Revert "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." > > This reverts commit 8fcd6537f242ffd74154a62dad410e573e2efc4b. > > Reason for revert: broke internal projects. > > Original change's description: > > RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation. > > > > Bug: webrtc:9577, webrtc:10480 > > Change-Id: I6d58866d48b8eaaa4102551b88d4f55133d1915c > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130482 > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#27387} > > TBR=gustaf@webrtc.org,alessiob@webrtc.org > > Change-Id: Ia05057326ebc277f334b13db0bfec9d4442903c2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9577, webrtc:10480 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130369 > Reviewed-by: Qingsi Wang <qingsi@webrtc.org> > Commit-Queue: Qingsi Wang <qingsi@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#27405} TBR=gustaf@webrtc.org,alessiob@webrtc.org,qingsi@webrtc.org Change-Id: I345f00d798fb67d0f02bf1e89319dac7f0287485 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9577, webrtc:10480 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130516 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27407}
2019-04-02 06:58:45 +00:00
// 24 kHz analysis.
// Define a higher minimum pitch period for the initial search. This is used to
// avoid searching for very short periods, for which a refinement step is
// responsible.
constexpr int kInitialMinPitch24kHz = 3 * kMinPitch24kHz;
static_assert(kMinPitch24kHz < kInitialMinPitch24kHz, "");
static_assert(kInitialMinPitch24kHz < kMaxPitch24kHz, "");
Reland "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." This reverts commit d38ce9f82402a995289b87e044125847d12eb658. Reason for revert: land this first, then fix downstream Original change's description: > Revert "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." > > This reverts commit 8fcd6537f242ffd74154a62dad410e573e2efc4b. > > Reason for revert: broke internal projects. > > Original change's description: > > RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation. > > > > Bug: webrtc:9577, webrtc:10480 > > Change-Id: I6d58866d48b8eaaa4102551b88d4f55133d1915c > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130482 > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#27387} > > TBR=gustaf@webrtc.org,alessiob@webrtc.org > > Change-Id: Ia05057326ebc277f334b13db0bfec9d4442903c2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9577, webrtc:10480 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130369 > Reviewed-by: Qingsi Wang <qingsi@webrtc.org> > Commit-Queue: Qingsi Wang <qingsi@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#27405} TBR=gustaf@webrtc.org,alessiob@webrtc.org,qingsi@webrtc.org Change-Id: I345f00d798fb67d0f02bf1e89319dac7f0287485 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9577, webrtc:10480 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130516 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27407}
2019-04-02 06:58:45 +00:00
static_assert(kMaxPitch24kHz > kInitialMinPitch24kHz, "");
Reland "RNN VAD: pitch search optimizations (part 1)" This reverts commit 1b6b958a4aa574b7852fe62efe5d4f96ce085d8b. Reason for revert: Bug fix Original change's description: > Revert "RNN VAD: pitch search optimizations (part 1)" > > This reverts commit 9da3e177fd5c2236cc15fea0ee8933e1dd0d8f6d. > > Reason for revert: bug in ComputePitchPeriod48kHz() > > Original change's description: > > RNN VAD: pitch search optimizations (part 1) > > > > TL;DR this CL improves efficiency and includes several code > > readability improvements mainly triggered by the comments to > > patch set #10. > > > > Highlights: > > - Split `FindBestPitchPeriods()` into 12 and 24 kHz versions > > to hard-code the input size and simplify the 24 kHz version > > - Loop in `ComputePitchPeriod48kHz()` (new name for > > `RefinePitchPeriod48kHz()`) removed since the lags for which > > we need to compute the auto correlation are a few > > - `ComputePitchGainThreshold()` was only used in unit tests; it's been > > moved into the anon ns and the test removed > > > > This CL makes `ComputePitchPeriod48kHz()` is about 10% faster (measured > > with https://webrtc-review.googlesource.com/c/src/+/191320/4/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc). > > The realtime factor has improved by about +14%. > > > > Benchmarked as follows: > > ``` > > out/release/modules_unittests \ > > --gtest_filter=*RnnVadTest.DISABLED_RnnVadPerformance* \ > > --gtest_also_run_disabled_tests --logs > > ``` > > > > Results: > > > > | baseline | this CL > > ------+----------------------+------------------------ > > run 1 | 24.0231 +/- 0.591016 | 23.568 +/- 0.990788 > > | 370.06x | 377.207x > > ------+----------------------+------------------------ > > run 2 | 24.0485 +/- 0.957498 | 23.3714 +/- 0.857523 > > | 369.67x | 380.379x > > ------+----------------------+------------------------ > > run 2 | 25.4091 +/- 2.6123 | 23.709 +/- 1.04477 > > | 349.875x | 374.963x > > > > Bug: webrtc:10480 > > Change-Id: I9a3e9164b2442114b928de506c92a547c273882f > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191320 > > Reviewed-by: Per Åhgren <peah@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#32568} > > TBR=alessiob@webrtc.org,peah@webrtc.org > > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10480 > Change-Id: I2a91f4f29566f872a7dfa220b31c6c625ed075db > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192660 > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#32581} TBR=alessiob@webrtc.org,peah@webrtc.org # Not skipping CQ checks because this is a reland. Bug: webrtc:10480 Change-Id: I66e3e8d73ebc04a437c01a0396cd5613c42a8cf5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192780 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32585}
2020-11-11 12:06:09 +01:00
// Number of (inverted) lags during the initial pitch search phase at 24 kHz.
constexpr int kInitialNumLags24kHz = kMaxPitch24kHz - kInitialMinPitch24kHz;
// Number of (inverted) lags during the pitch search refinement phase at 24 kHz.
constexpr int kRefineNumLags24kHz = kMaxPitch24kHz + 1;
static_assert(
kRefineNumLags24kHz > kInitialNumLags24kHz,
"The refinement step must search the pitch in an extended pitch range.");
// 12 kHz analysis.
constexpr int kSampleRate12kHz = 12000;
constexpr int kFrameSize10ms12kHz = kSampleRate12kHz / 100;
constexpr int kFrameSize20ms12kHz = kFrameSize10ms12kHz * 2;
constexpr int kBufSize12kHz = kBufSize24kHz / 2;
constexpr int kInitialMinPitch12kHz = kInitialMinPitch24kHz / 2;
constexpr int kMaxPitch12kHz = kMaxPitch24kHz / 2;
Reland "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." This reverts commit d38ce9f82402a995289b87e044125847d12eb658. Reason for revert: land this first, then fix downstream Original change's description: > Revert "RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation." > > This reverts commit 8fcd6537f242ffd74154a62dad410e573e2efc4b. > > Reason for revert: broke internal projects. > > Original change's description: > > RNN VAD: Replace Ooura with PFFFT for the pitch auto correlation. > > > > Bug: webrtc:9577, webrtc:10480 > > Change-Id: I6d58866d48b8eaaa4102551b88d4f55133d1915c > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130482 > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#27387} > > TBR=gustaf@webrtc.org,alessiob@webrtc.org > > Change-Id: Ia05057326ebc277f334b13db0bfec9d4442903c2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9577, webrtc:10480 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130369 > Reviewed-by: Qingsi Wang <qingsi@webrtc.org> > Commit-Queue: Qingsi Wang <qingsi@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#27405} TBR=gustaf@webrtc.org,alessiob@webrtc.org,qingsi@webrtc.org Change-Id: I345f00d798fb67d0f02bf1e89319dac7f0287485 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9577, webrtc:10480 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130516 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27407}
2019-04-02 06:58:45 +00:00
static_assert(kMaxPitch12kHz > kInitialMinPitch12kHz, "");
// The inverted lags for the pitch interval [`kInitialMinPitch12kHz`,
// `kMaxPitch12kHz`] are in the range [0, `kNumLags12kHz`].
Reland "RNN VAD: pitch search optimizations (part 1)" This reverts commit 1b6b958a4aa574b7852fe62efe5d4f96ce085d8b. Reason for revert: Bug fix Original change's description: > Revert "RNN VAD: pitch search optimizations (part 1)" > > This reverts commit 9da3e177fd5c2236cc15fea0ee8933e1dd0d8f6d. > > Reason for revert: bug in ComputePitchPeriod48kHz() > > Original change's description: > > RNN VAD: pitch search optimizations (part 1) > > > > TL;DR this CL improves efficiency and includes several code > > readability improvements mainly triggered by the comments to > > patch set #10. > > > > Highlights: > > - Split `FindBestPitchPeriods()` into 12 and 24 kHz versions > > to hard-code the input size and simplify the 24 kHz version > > - Loop in `ComputePitchPeriod48kHz()` (new name for > > `RefinePitchPeriod48kHz()`) removed since the lags for which > > we need to compute the auto correlation are a few > > - `ComputePitchGainThreshold()` was only used in unit tests; it's been > > moved into the anon ns and the test removed > > > > This CL makes `ComputePitchPeriod48kHz()` is about 10% faster (measured > > with https://webrtc-review.googlesource.com/c/src/+/191320/4/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc). > > The realtime factor has improved by about +14%. > > > > Benchmarked as follows: > > ``` > > out/release/modules_unittests \ > > --gtest_filter=*RnnVadTest.DISABLED_RnnVadPerformance* \ > > --gtest_also_run_disabled_tests --logs > > ``` > > > > Results: > > > > | baseline | this CL > > ------+----------------------+------------------------ > > run 1 | 24.0231 +/- 0.591016 | 23.568 +/- 0.990788 > > | 370.06x | 377.207x > > ------+----------------------+------------------------ > > run 2 | 24.0485 +/- 0.957498 | 23.3714 +/- 0.857523 > > | 369.67x | 380.379x > > ------+----------------------+------------------------ > > run 2 | 25.4091 +/- 2.6123 | 23.709 +/- 1.04477 > > | 349.875x | 374.963x > > > > Bug: webrtc:10480 > > Change-Id: I9a3e9164b2442114b928de506c92a547c273882f > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191320 > > Reviewed-by: Per Åhgren <peah@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#32568} > > TBR=alessiob@webrtc.org,peah@webrtc.org > > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10480 > Change-Id: I2a91f4f29566f872a7dfa220b31c6c625ed075db > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192660 > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#32581} TBR=alessiob@webrtc.org,peah@webrtc.org # Not skipping CQ checks because this is a reland. Bug: webrtc:10480 Change-Id: I66e3e8d73ebc04a437c01a0396cd5613c42a8cf5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192780 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32585}
2020-11-11 12:06:09 +01:00
constexpr int kNumLags12kHz = kMaxPitch12kHz - kInitialMinPitch12kHz;
// 48 kHz constants.
constexpr int kMinPitch48kHz = kMinPitch24kHz * 2;
constexpr int kMaxPitch48kHz = kMaxPitch24kHz * 2;
// Spectral features.
constexpr int kNumBands = 22;
constexpr int kNumLowerBands = 6;
static_assert((0 < kNumLowerBands) && (kNumLowerBands < kNumBands), "");
constexpr int kCepstralCoeffsHistorySize = 8;
static_assert(kCepstralCoeffsHistorySize > 2,
"The history size must at least be 3 to compute first and second "
"derivatives.");
constexpr int kFeatureVectorSize = 42;
Reland "Reland "AGC2 RNN VAD: Recurrent Neural Network impl"" This reverts commit 3c9f47434f0af3b16f1b8f43cd4500be6fd2ac17. Reason for revert: downstream projects fixed Original change's description: > Revert "Reland "AGC2 RNN VAD: Recurrent Neural Network impl"" > > This reverts commit e0bba68edea74ca33f4c492eba290c089f233f6b. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Reland "AGC2 RNN VAD: Recurrent Neural Network impl" > > > > This reverts commit 97e349ace7a3fd64fff270f0d780e02bb708f503. > > > > Reason for revert: downstream projects fixed > > > > Original change's description: > > > Revert "AGC2 RNN VAD: Recurrent Neural Network impl" > > > > > > This reverts commit 2491cb73820fe82923b848dfcab6772b4b0addb0. > > > > > > Reason for revert: broke internal build > > > > > > Original change's description: > > > > AGC2 RNN VAD: Recurrent Neural Network impl > > > > > > > > RNN implementation for the AGC2 VAD that includes a fully connected > > > > layer and a gated recurrent unit layer. > > > > > > > > Bug: webrtc:9076 > > > > Change-Id: Ibb8b0b4e9213f09eb9dbe118bbdc94d7e8e4f91b > > > > Reviewed-on: https://webrtc-review.googlesource.com/72060 > > > > Reviewed-by: Patrik Höglund <phoglund@webrtc.org> > > > > Reviewed-by: Alex Loiko <aleloi@webrtc.org> > > > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org> > > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > > Cr-Commit-Position: refs/heads/master@{#23101} > > > > > > TBR=phoglund@webrtc.org,alessiob@webrtc.org,aleloi@webrtc.org,ivoc@webrtc.org > > > > > > Change-Id: Ic311c4b7d79094e959d3a2c4a53c398f34c954e2 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:9076 > > > Reviewed-on: https://webrtc-review.googlesource.com/74200 > > > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > > > Commit-Queue: Sam Zackrisson <saza@webrtc.org> > > > Cr-Commit-Position: refs/heads/master@{#23103} > > > > TBR=phoglund@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,aleloi@webrtc.org,ivoc@webrtc.org > > > > Change-Id: I0c7f8e0f59be926322d05b1da1d4d19c0777dab2 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: webrtc:9076 > > Reviewed-on: https://webrtc-review.googlesource.com/74460 > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#23113} > > TBR=phoglund@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,aleloi@webrtc.org,ivoc@webrtc.org > > Change-Id: I3985a6d38df1d4438a50d031bc9f6cf41eb83121 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9076 > Reviewed-on: https://webrtc-review.googlesource.com/74560 > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > Commit-Queue: Sam Zackrisson <saza@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23117} TBR=phoglund@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,aleloi@webrtc.org,ivoc@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:9076 Change-Id: I4d81786837017d4daf0dbb1218306795b977ade5 Reviewed-on: https://webrtc-review.googlesource.com/74760 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23138}
2018-05-07 09:29:54 +00:00
Reland "Reland "AGC2 RNN VAD: initial build targets"" This reverts commit 772d43d4c0acbbc09c3dc280c0ffd17e9569700b. Reason for revert: fix issues and reland revert Original change's description: > Revert "Reland "AGC2 RNN VAD: initial build targets"" > > This reverts commit e0031500bafa4b114adfb2d29444592f1e7b3795. > > Reason for revert: reland automatically landed by mistake > > Original change's description: > > Reland "AGC2 RNN VAD: initial build targets" > > > > This reverts commit a153c00bceb832e697365f52e6a7697fdf210efa. > > > > Reason for revert: fix issues and reland revert > > > > Original change's description: > > > Revert "AGC2 RNN VAD: initial build targets" > > > > > > This reverts commit 8628f5bb7c7f5bd0373567095af08cebe8bb7f8d. > > > > > > Reason for revert: iOS buildbot failing > > > > > > Original change's description: > > > > AGC2 RNN VAD: initial build targets > > > > > > > > rnn_vad_tool is an executable that reads a wav file of any sample rate > > > > compatible with 10 ms frames that are resampled and, when the VAD is > > > > fully landed, will process the resampled frames to compute the VAD > > > > probability. > > > > > > > > To avoid mac, win and ios trybot failures, to_be_removed.h/.cc have > > > > been added and will be removed as soon as the :lib target includes > > > > code that leads to a non-empty static lib file on those platforms. > > > > > > > > Bug: webrtc:9076 > > > > Change-Id: I810c08acfa1adf2029e3baac2adda3045ae5214a > > > > Reviewed-on: https://webrtc-review.googlesource.com/70202 > > > > Reviewed-by: Alex Loiko <aleloi@webrtc.org> > > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > > Cr-Commit-Position: refs/heads/master@{#22898} > > > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > > > Change-Id: Ic6014dde78b0ef371804c52608145ba8acdd9c97 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:9076 > > > Reviewed-on: https://webrtc-review.googlesource.com/70144 > > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > > Cr-Commit-Position: refs/heads/master@{#22899} > > > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > > > Change-Id: I55e5a77274684b4cff3c950ca3514cc769d5dc26 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: webrtc:9076 > > Reviewed-on: https://webrtc-review.googlesource.com/70145 > > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22901} > > TBR=alessiob@webrtc.org,aleloi@webrtc.org > > Change-Id: Ia6a837f79ac3f12aa4b0659938454141c69fee61 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9076 > Reviewed-on: https://webrtc-review.googlesource.com/70520 > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22902} TBR=alessiob@webrtc.org,aleloi@webrtc.org Change-Id: If0884ab59d66ac3ba6460dbfe14a083f20493c10 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9076 Reviewed-on: https://webrtc-review.googlesource.com/70521 Reviewed-by: Minyue Li <minyue@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22904}
2018-04-17 15:58:40 +02:00
} // namespace rnn_vad
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_COMMON_H_