From c14e3572c6c1400aa8ccd909893fc996b9b0ef09 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Mon, 12 Jan 2015 05:50:52 +0000 Subject: [PATCH] common_audio: Made input signal const in WebRtcSplFilterMAFastQ12() BUG=3353, 1133 TESTED=locally on Mac and trybots R=henrik.lundin@webrtc.org, kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/37499004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8037 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../signal_processing/filter_ma_fast_q12.c | 4 +-- .../include/signal_processing_library.h | 34 +++++++++---------- webrtc/modules/audio_coding/neteq/expand.cc | 8 +++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/webrtc/common_audio/signal_processing/filter_ma_fast_q12.c b/webrtc/common_audio/signal_processing/filter_ma_fast_q12.c index d40918d6bc..943b01c1d9 100644 --- a/webrtc/common_audio/signal_processing/filter_ma_fast_q12.c +++ b/webrtc/common_audio/signal_processing/filter_ma_fast_q12.c @@ -17,9 +17,9 @@ #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" -void WebRtcSpl_FilterMAFastQ12(int16_t* in_ptr, +void WebRtcSpl_FilterMAFastQ12(const int16_t* in_ptr, int16_t* out_ptr, - int16_t* B, + const int16_t* B, int16_t B_length, int16_t length) { diff --git a/webrtc/common_audio/signal_processing/include/signal_processing_library.h b/webrtc/common_audio/signal_processing/include/signal_processing_library.h index f60f2542d9..ff1700983e 100644 --- a/webrtc/common_audio/signal_processing/include/signal_processing_library.h +++ b/webrtc/common_audio/signal_processing/include/signal_processing_library.h @@ -650,9 +650,23 @@ int WebRtcSpl_FilterAR(const int16_t* ar_coef, int16_t* out_vector_low, int out_vector_low_length); -void WebRtcSpl_FilterMAFastQ12(int16_t* in_vector, +// WebRtcSpl_FilterMAFastQ12(...) +// +// Performs a MA filtering on a vector in Q12 +// +// Input: +// - in_vector : Input samples (state in positions +// in_vector[-order] .. in_vector[-1]) +// - ma_coef : Filter coefficients (in Q12) +// - ma_coef_length : Number of B coefficients (order+1) +// - vector_length : Number of samples to be filtered +// +// Output: +// - out_vector : Filtered samples +// +void WebRtcSpl_FilterMAFastQ12(const int16_t* in_vector, int16_t* out_vector, - int16_t* ma_coef, + const int16_t* ma_coef, int16_t ma_coef_length, int16_t vector_length); @@ -1499,22 +1513,6 @@ void WebRtcSpl_SynthesisQMF(const int16_t* low_band, // Return value : Number of samples in the |out_vector|. // -// -// WebRtcSpl_FilterMAFastQ12(...) -// -// Performs a MA filtering on a vector in Q12 -// -// Input: -// - in_vector : Input samples (state in positions -// in_vector[-order] .. in_vector[-1]) -// - ma_coef : Filter coefficients (in Q12) -// - ma_coef_length : Number of B coefficients (order+1) -// - vector_length : Number of samples to be filtered -// -// Output: -// - out_vector : Filtered samples -// - // // WebRtcSpl_ComplexIFFT(...) // diff --git a/webrtc/modules/audio_coding/neteq/expand.cc b/webrtc/modules/audio_coding/neteq/expand.cc index 49ea45f492..d13c2cdf8d 100644 --- a/webrtc/modules/audio_coding/neteq/expand.cc +++ b/webrtc/modules/audio_coding/neteq/expand.cc @@ -618,9 +618,11 @@ void Expand::AnalyzeSignal(int16_t* random_vector) { memcpy(unvoiced_vector - kUnvoicedLpcOrder, &(audio_history[signal_length - 128 - kUnvoicedLpcOrder]), sizeof(int16_t) * kUnvoicedLpcOrder); - WebRtcSpl_FilterMAFastQ12( - const_cast(&audio_history[signal_length - 128]), - unvoiced_vector, parameters.ar_filter, kUnvoicedLpcOrder + 1, 128); + WebRtcSpl_FilterMAFastQ12(&audio_history[signal_length - 128], + unvoiced_vector, + parameters.ar_filter, + kUnvoicedLpcOrder + 1, + 128); int16_t unvoiced_prescale; if (WebRtcSpl_MaxAbsValueW16(unvoiced_vector, 128) > 4000) { unvoiced_prescale = 4;