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}
This commit is contained in:
Henrik Lundin
2015-05-27 14:33:29 +02:00
parent cbe408aa11
commit cf808d2366
13 changed files with 172 additions and 58 deletions

View File

@ -34,7 +34,8 @@ PreemptiveExpand::ReturnCodes PreemptiveExpand::Process(
output->PushBackInterleaved(input, input_length);
return kError;
}
return TimeStretch::Process(input, input_length, output,
const bool kFastMode = false; // Fast mode is not available for PE Expand.
return TimeStretch::Process(input, input_length, kFastMode, output,
length_change_samples);
}
@ -54,8 +55,12 @@ void PreemptiveExpand::SetParametersForPassiveSpeech(size_t len,
}
PreemptiveExpand::ReturnCodes PreemptiveExpand::CheckCriteriaAndStretch(
const int16_t *input, size_t input_length, size_t peak_index,
int16_t best_correlation, bool active_speech,
const int16_t* input,
size_t input_length,
size_t peak_index,
int16_t best_correlation,
bool active_speech,
bool /*fast_mode*/,
AudioMultiVector* output) const {
// Pre-calculate common multiplication with |fs_mult_|.
// 120 corresponds to 15 ms.