Reland "Avoiding overflow in cross correlation in NetEq."
The original CL is https://codereview.webrtc.org/1908623002/
An error was caused by that and this CL fix that problem and reland the CL.
BUG=
Review-Url: https://codereview.webrtc.org/1931933004
Cr-Commit-Position: refs/heads/master@{#12589}
diff --git a/webrtc/modules/audio_coding/neteq/merge.h b/webrtc/modules/audio_coding/neteq/merge.h
index a168502..95dea5a 100644
--- a/webrtc/modules/audio_coding/neteq/merge.h
+++ b/webrtc/modules/audio_coding/neteq/merge.h
@@ -69,11 +69,10 @@
// of samples that were taken from the |sync_buffer_|.
size_t GetExpandedSignal(size_t* old_length, size_t* expand_period);
- // Analyzes |input| and |expanded_signal| to find maximum values. Returns
- // a muting factor (Q14) to be used on the new data.
+ // Analyzes |input| and |expanded_signal| and returns muting factor (Q14) to
+ // be used on the new data.
int16_t SignalScaling(const int16_t* input, size_t input_length,
- const int16_t* expanded_signal,
- int16_t* expanded_max, int16_t* input_max) const;
+ const int16_t* expanded_signal) const;
// Downsamples |input| (|input_length| samples) and |expanded_signal| to
// 4 kHz sample rate. The downsampled signals are written to
@@ -84,8 +83,7 @@
// Calculates cross-correlation between |input_downsampled_| and
// |expanded_downsampled_|, and finds the correlation maximum. The maximizing
// lag is returned.
- size_t CorrelateAndPeakSearch(int16_t expanded_max, int16_t input_max,
- size_t start_position, size_t input_length,
+ size_t CorrelateAndPeakSearch(size_t start_position, size_t input_length,
size_t expand_period) const;
const int fs_mult_; // fs_hz_ / 8000.