/* * Copyright (c) 2011 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. */ /* * This header file contains some internal resampling functions. * */ #include "common_audio/signal_processing/resample_by_2_internal.h" #include "rtc_base/sanitizer.h" // allpass filter coefficients. static const int16_t kResampleAllpass[2][3] = …; // // decimator // input: int32_t (shifted 15 positions to the left, + offset 16384) OVERWRITTEN! // output: int16_t (saturated) (of length len/2) // state: filter state array; length = 8 void RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/5486 WebRtcSpl_DownBy2IntToShort(int32_t *in, int32_t len, int16_t *out, int32_t *state) { … } // // decimator // input: int16_t // output: int32_t (shifted 15 positions to the left, + offset 16384) (of length len/2) // state: filter state array; length = 8 void RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/5486 WebRtcSpl_DownBy2ShortToInt(const int16_t *in, int32_t len, int32_t *out, int32_t *state) { … } // // interpolator // input: int16_t // output: int32_t (normalized, not saturated) (of length len*2) // state: filter state array; length = 8 void WebRtcSpl_UpBy2ShortToInt(const int16_t *in, int32_t len, int32_t *out, int32_t *state) { … } // // interpolator // input: int32_t (shifted 15 positions to the left, + offset 16384) // output: int32_t (shifted 15 positions to the left, + offset 16384) (of length len*2) // state: filter state array; length = 8 void WebRtcSpl_UpBy2IntToInt(const int32_t *in, int32_t len, int32_t *out, int32_t *state) { … } // // interpolator // input: int32_t (shifted 15 positions to the left, + offset 16384) // output: int16_t (saturated) (of length len*2) // state: filter state array; length = 8 void WebRtcSpl_UpBy2IntToShort(const int32_t *in, int32_t len, int16_t *out, int32_t *state) { … } // lowpass filter // input: int16_t // output: int32_t (normalized, not saturated) // state: filter state array; length = 8 void WebRtcSpl_LPBy2ShortToInt(const int16_t* in, int32_t len, int32_t* out, int32_t* state) { … } // lowpass filter // input: int32_t (shifted 15 positions to the left, + offset 16384) // output: int32_t (normalized, not saturated) // state: filter state array; length = 8 void RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/5486 WebRtcSpl_LPBy2IntToInt(const int32_t* in, int32_t len, int32_t* out, int32_t* state) { … }