Add new fast mode for NetEq's Accelerate operation
This change instroduces a mode where the Accelerate operation will be
more aggressive. When enabled, it will allow acceleration at lower
correlation levels, and possibly remove multiple pitch periods at
once.
The feature is enabled through NetEq::Config, and is off by
default. This means that bit-exactness tests are currently not
affected.
A unit test was added for the Accelerate class, with and without fast
mode enabled.
BUG=4691
R=minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/50039004
Cr-Commit-Position: refs/heads/master@{#9295}
diff --git a/webrtc/modules/audio_coding/neteq/accelerate.h b/webrtc/modules/audio_coding/neteq/accelerate.h
index 36bc094..684f74b 100644
--- a/webrtc/modules/audio_coding/neteq/accelerate.h
+++ b/webrtc/modules/audio_coding/neteq/accelerate.h
@@ -38,9 +38,12 @@
// read from |input|, of length |input_length| elements, and are written to
// |output|. The number of samples removed through time-stretching is
// is provided in the output |length_change_samples|. The method returns
- // the outcome of the operation as an enumerator value.
+ // the outcome of the operation as an enumerator value. If |fast_accelerate|
+ // is true, the algorithm will relax the requirements on finding strong
+ // correlations, and may remove multiple pitch periods if possible.
ReturnCodes Process(const int16_t* input,
size_t input_length,
+ bool fast_accelerate,
AudioMultiVector* output,
int16_t* length_change_samples);
@@ -58,6 +61,7 @@
size_t peak_index,
int16_t best_correlation,
bool active_speech,
+ bool fast_mode,
AudioMultiVector* output) const override;
private: